changeset 1932:cb75225afcd4

Use variadic macro for plugin debug message printing.
author Deepak Bhole <dbhole@redhat.com>
date Mon, 12 Jul 2010 18:41:55 -0400
parents d8eb9c640eb4
children fe894254bf91
files ChangeLog plugin/icedteanp/IcedTeaJavaRequestProcessor.cc plugin/icedteanp/IcedTeaJavaRequestProcessor.h plugin/icedteanp/IcedTeaNPPlugin.cc plugin/icedteanp/IcedTeaPluginRequestProcessor.cc plugin/icedteanp/IcedTeaPluginUtils.cc plugin/icedteanp/IcedTeaPluginUtils.h plugin/icedteanp/IcedTeaScriptablePluginObject.cc
diffstat 8 files changed, 242 insertions(+), 285 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jul 12 11:13:35 2010 -0400
+++ b/ChangeLog	Mon Jul 12 18:41:55 2010 -0400
@@ -1,3 +1,14 @@
+2010-06-14  Deepak Bhole <dbhole@redhat.com>
+
+	* plugin/icedteanp/IcedTeaJavaRequestProcessor.cc: Use variadic macro
+	for debug message printing.
+	* plugin/icedteanp/IcedTeaJavaRequestProcessor.h: Same.
+	* plugin/icedteanp/IcedTeaNPPlugin.cc: Same.
+	* plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Same.
+	* plugin/icedteanp/IcedTeaPluginUtils.cc: Same.
+	* plugin/icedteanp/IcedTeaPluginUtils.h: Same.
+	* plugin/icedteanp/IcedTeaScriptablePluginObject.cc: Same.
+
 2010-07-12 Jon VanAlten <jon.vanalten@redhat.com>
 	* pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java
 	* pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java
--- a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc	Mon Jul 12 11:13:35 2010 -0400
+++ b/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc	Mon Jul 12 18:41:55 2010 -0400
@@ -179,7 +179,7 @@
 
 JavaRequestProcessor::JavaRequestProcessor()
 {
-    PLUGIN_DEBUG_0ARG("JavaRequestProcessor constructor\n");
+    PLUGIN_DEBUG("JavaRequestProcessor constructor\n");
 
 	// caller frees this
 	result = new JavaResultData();
@@ -200,7 +200,7 @@
 
 JavaRequestProcessor::~JavaRequestProcessor()
 {
-    PLUGIN_DEBUG_0ARG("JavaRequestProcessor::~JavaRequestProcessor\n");
+    PLUGIN_DEBUG("JavaRequestProcessor::~JavaRequestProcessor\n");
 
 	if (result)
 	{
@@ -271,7 +271,7 @@
     	result->error_msg->append("Error: Timed out when waiting for response");
 
     	// Report error
-    	PLUGIN_DEBUG_1ARG("Error: Timed out when waiting for response to %s\n", message.c_str());
+    	PLUGIN_DEBUG("Error: Timed out when waiting for response to %s\n", message.c_str());
     }
 
     java_to_plugin_bus->unSubscribe(this);
@@ -847,12 +847,12 @@
 
     if (NPVARIANT_IS_VOID(variant))
     {
-    	PLUGIN_DEBUG_1ARG("VOID %d\n", variant);
+    	PLUGIN_DEBUG("VOID %d\n", variant);
     	id->append("0");
     	return; // no need to go further
     } else if (NPVARIANT_IS_NULL(variant))
     {
-    	PLUGIN_DEBUG_1ARG("NULL\n", variant);
+    	PLUGIN_DEBUG("NULL\n", variant);
     	id->append("0");
     	return; // no need to go further
     } else if (NPVARIANT_IS_BOOLEAN(variant))
@@ -894,18 +894,18 @@
         NPObject* obj = NPVARIANT_TO_OBJECT(variant);
         if (IcedTeaScriptableJavaPackageObject::is_valid_java_object(obj))
         {
-            PLUGIN_DEBUG_0ARG("NPObject is a Java object\n");
+            PLUGIN_DEBUG("NPObject is a Java object\n");
             alreadyCreated = true;
         } else
         {
-            PLUGIN_DEBUG_0ARG("NPObject is not a Java object\n");
+            PLUGIN_DEBUG("NPObject is not a Java object\n");
             NPIdentifier length_id = browser_functions.getstringidentifier("length");
 
             // FIXME: We currently only handle <= 2 dim arrays. Do we really need more though?
 
             // Is it an array?
             if (IcedTeaPluginUtilities::isObjectJSArray(instance, obj)) {
-                PLUGIN_DEBUG_0ARG("NPObject is an array\n");
+                PLUGIN_DEBUG("NPObject is an array\n");
 
                 std::string array_id = std::string();
                 std::string java_array_type = std::string();
--- a/plugin/icedteanp/IcedTeaJavaRequestProcessor.h	Mon Jul 12 11:13:35 2010 -0400
+++ b/plugin/icedteanp/IcedTeaJavaRequestProcessor.h	Mon Jul 12 18:41:55 2010 -0400
@@ -46,7 +46,7 @@
 #include "IcedTeaNPPlugin.h"
 #include "IcedTeaPluginUtils.h"
 
-#define REQUESTTIMEOUT 120
+#define REQUESTTIMEOUT 10
 
 /*
  * This struct holds data specific to a Java operation requested by the plugin
--- a/plugin/icedteanp/IcedTeaNPPlugin.cc	Mon Jul 12 11:13:35 2010 -0400
+++ b/plugin/icedteanp/IcedTeaNPPlugin.cc	Mon Jul 12 18:41:55 2010 -0400
@@ -262,7 +262,7 @@
          int16_t argc, char* argn[], char* argv[],
          NPSavedData* saved)
 {
-  PLUGIN_DEBUG_0ARG("ITNP_New\n");
+  PLUGIN_DEBUG("ITNP_New\n");
 
   static NPObject *window_ptr;
   NPIdentifier identifier;
@@ -275,7 +275,7 @@
   }
   browser_functions.getproperty(instance, window_ptr, identifier, &member_ptr);
 
-  PLUGIN_DEBUG_1ARG("Got variant %p\n", &member_ptr);
+  PLUGIN_DEBUG("Got variant %p\n", &member_ptr);
 
 
   NPError np_error = NPERR_NO_ERROR;
@@ -395,12 +395,12 @@
   documentbase = NULL;
 
   // store an identifier for this plugin
-  PLUGIN_DEBUG_2ARG("Mapping id %d and instance %p\n", instance_counter, instance);
+  PLUGIN_DEBUG("Mapping id %d and instance %p\n", instance_counter, instance);
   g_hash_table_insert(instance_to_id_map, instance, GINT_TO_POINTER(instance_counter));
   g_hash_table_insert(id_to_instance_map, GINT_TO_POINTER(instance_counter), instance);
   instance_counter++;
 
-  PLUGIN_DEBUG_0ARG ("ITNP_New return\n");
+  PLUGIN_DEBUG ("ITNP_New return\n");
 
   return np_error;
 }
@@ -415,16 +415,16 @@
   GMutex *vm_start_mutex = g_mutex_new();
   g_mutex_lock(vm_start_mutex);
 
-  PLUGIN_DEBUG_0ARG("Checking JVM status...\n");
+  PLUGIN_DEBUG("Checking JVM status...\n");
 
   // If the jvm is already up, do nothing
   if (jvm_up)
   {
-      PLUGIN_DEBUG_0ARG("JVM is up. Returning.\n");
+      PLUGIN_DEBUG("JVM is up. Returning.\n");
       return;
   }
 
-  PLUGIN_DEBUG_0ARG("No JVM is running. Attempting to start one...\n");
+  PLUGIN_DEBUG("No JVM is running. Attempting to start one...\n");
 
   NPError np_error = NPERR_NO_ERROR;
   ITNPPluginData* data = NULL;
@@ -447,14 +447,14 @@
   // clean up any older pip
   unlink (in_pipe_name);
 
-  PLUGIN_DEBUG_1ARG ("ITNP_New: creating input fifo: %s\n", in_pipe_name);
+  PLUGIN_DEBUG ("ITNP_New: creating input fifo: %s\n", in_pipe_name);
   if (mkfifo (in_pipe_name, 0600) == -1 && errno != EEXIST)
     {
       PLUGIN_ERROR_TWO ("Failed to create input pipe", strerror (errno));
       np_error = NPERR_GENERIC_ERROR;
       goto cleanup_in_pipe_name;
     }
-  PLUGIN_DEBUG_1ARG ("ITNP_New: created input fifo: %s\n", in_pipe_name);
+  PLUGIN_DEBUG ("ITNP_New: created input fifo: %s\n", in_pipe_name);
 
   // Create plugin-to-appletviewer pipe which we refer to as the
   // output pipe.
@@ -473,14 +473,14 @@
   // clean up any older pip
   unlink (out_pipe_name);
 
-  PLUGIN_DEBUG_1ARG ("ITNP_New: creating output fifo: %s\n", out_pipe_name);
+  PLUGIN_DEBUG ("ITNP_New: creating output fifo: %s\n", out_pipe_name);
   if (mkfifo (out_pipe_name, 0600) == -1 && errno != EEXIST)
     {
       PLUGIN_ERROR_TWO ("Failed to create output pipe", strerror (errno));
       np_error = NPERR_GENERIC_ERROR;
       goto cleanup_out_pipe_name;
     }
-  PLUGIN_DEBUG_1ARG ("ITNP_New: created output fifo: %s\n", out_pipe_name);
+  PLUGIN_DEBUG ("ITNP_New: created output fifo: %s\n", out_pipe_name);
 
   // Start a separate appletviewer process for each applet, even if
   // there are multiple applets in the same page.  We may need to
@@ -571,9 +571,9 @@
 
   // cleanup_out_pipe:
   // Delete output pipe.
-  PLUGIN_DEBUG_1ARG ("ITNP_New: deleting input fifo: %s\n", in_pipe_name);
+  PLUGIN_DEBUG ("ITNP_New: deleting input fifo: %s\n", in_pipe_name);
   unlink (out_pipe_name);
-  PLUGIN_DEBUG_1ARG ("ITNP_New: deleted input fifo: %s\n", in_pipe_name);
+  PLUGIN_DEBUG ("ITNP_New: deleted input fifo: %s\n", in_pipe_name);
 
  cleanup_out_pipe_name:
   g_free (out_pipe_name);
@@ -581,9 +581,9 @@
 
   // cleanup_in_pipe:
   // Delete input pipe.
-  PLUGIN_DEBUG_1ARG ("ITNP_New: deleting output fifo: %s\n", out_pipe_name);
+  PLUGIN_DEBUG ("ITNP_New: deleting output fifo: %s\n", out_pipe_name);
   unlink (in_pipe_name);
-  PLUGIN_DEBUG_1ARG ("ITNP_New: deleted output fifo: %s\n", out_pipe_name);
+  PLUGIN_DEBUG ("ITNP_New: deleted output fifo: %s\n", out_pipe_name);
 
  cleanup_in_pipe_name:
   g_free (in_pipe_name);
@@ -599,7 +599,7 @@
 NPError
 ITNP_GetValue (NPP instance, NPPVariable variable, void* value)
 {
-  PLUGIN_DEBUG_0ARG ("ITNP_GetValue\n");
+  PLUGIN_DEBUG ("ITNP_GetValue\n");
 
   NPError np_error = NPERR_NO_ERROR;
 
@@ -608,7 +608,7 @@
     // This plugin needs XEmbed support.
     case NPPVpluginNeedsXEmbed:
       {
-        PLUGIN_DEBUG_0ARG ("ITNP_GetValue: returning TRUE for NeedsXEmbed.\n");
+        PLUGIN_DEBUG ("ITNP_GetValue: returning TRUE for NeedsXEmbed.\n");
         bool* bool_value = (bool*) value;
         *bool_value = true;
       }
@@ -624,7 +624,7 @@
       break;
     }
 
-  PLUGIN_DEBUG_0ARG ("ITNP_GetValue return\n");
+  PLUGIN_DEBUG ("ITNP_GetValue return\n");
 
   return np_error;
 }
@@ -632,7 +632,7 @@
 NPError
 ITNP_Destroy (NPP instance, NPSavedData** save)
 {
-  PLUGIN_DEBUG_1ARG ("ITNP_Destroy %p\n", instance);
+  PLUGIN_DEBUG ("ITNP_Destroy %p\n", instance);
 
   ITNPPluginData* data = (ITNPPluginData*) instance->pdata;
 
@@ -649,7 +649,7 @@
 
   IcedTeaPluginUtilities::invalidateInstance(instance);
 
-  PLUGIN_DEBUG_0ARG ("ITNP_Destroy return\n");
+  PLUGIN_DEBUG ("ITNP_Destroy return\n");
 
   return NPERR_NO_ERROR;
 }
@@ -657,7 +657,7 @@
 NPError
 ITNP_SetWindow (NPP instance, NPWindow* window)
 {
-  PLUGIN_DEBUG_0ARG ("ITNP_SetWindow\n");
+  PLUGIN_DEBUG ("ITNP_SetWindow\n");
 
   if (instance == NULL)
     {
@@ -679,7 +679,7 @@
   // Simply return if we receive a NULL window.
   if ((window == NULL) || (window->window == NULL))
     {
-      PLUGIN_DEBUG_0ARG ("ITNP_SetWindow: got NULL window.\n");
+      PLUGIN_DEBUG ("ITNP_SetWindow: got NULL window.\n");
 
       return NPERR_NO_ERROR;
     }
@@ -690,7 +690,7 @@
       if (data->window_handle == window->window)
     {
           // The parent window is the same as in previous calls.
-          PLUGIN_DEBUG_0ARG ("ITNP_SetWindow: window already exists.\n");
+          PLUGIN_DEBUG ("ITNP_SetWindow: window already exists.\n");
 
           // Critical region.  Read data->appletviewer_mutex and send
           // a message to the appletviewer.
@@ -704,7 +704,7 @@
           // SetWindow call.
           if (window->width != data->window_width)
         {
-                  PLUGIN_DEBUG_0ARG ("ITNP_SetWindow: window width changed.\n");
+                  PLUGIN_DEBUG ("ITNP_SetWindow: window width changed.\n");
           // The width of the plugin window has changed.
 
                   // Store the new width.
@@ -714,7 +714,7 @@
 
           if (window->height != data->window_height)
         {
-                  PLUGIN_DEBUG_0ARG ("ITNP_SetWindow: window height changed.\n");
+                  PLUGIN_DEBUG ("ITNP_SetWindow: window height changed.\n");
           // The height of the plugin window has changed.
 
                   // Store the new height.
@@ -736,7 +736,7 @@
       else
         {
               // The appletviewer is not running.
-          PLUGIN_DEBUG_0ARG ("ITNP_SetWindow: appletviewer is not running.\n");
+          PLUGIN_DEBUG ("ITNP_SetWindow: appletviewer is not running.\n");
         }
 
           g_mutex_unlock (data->appletviewer_mutex);
@@ -745,12 +745,12 @@
     {
       // The parent window has changed.  This branch does run but
       // doing nothing in response seems to be sufficient.
-      PLUGIN_DEBUG_0ARG ("ITNP_SetWindow: parent window changed.\n");
+      PLUGIN_DEBUG ("ITNP_SetWindow: parent window changed.\n");
     }
     }
   else
     {
-      PLUGIN_DEBUG_0ARG ("ITNP_SetWindow: setting window.\n");
+      PLUGIN_DEBUG ("ITNP_SetWindow: setting window.\n");
 
       // Critical region.  Send messages to appletviewer.
       g_mutex_lock (data->appletviewer_mutex);
@@ -774,7 +774,7 @@
       data->window_handle = window->window;
     }
 
-  PLUGIN_DEBUG_0ARG ("ITNP_SetWindow return\n");
+  PLUGIN_DEBUG ("ITNP_SetWindow return\n");
 
   return NPERR_NO_ERROR;
 }
@@ -783,9 +783,9 @@
 ITNP_NewStream (NPP instance, NPMIMEType type, NPStream* stream,
                NPBool seekable, uint16_t* stype)
 {
-  PLUGIN_DEBUG_0ARG ("ITNP_NewStream\n");
-
-  PLUGIN_DEBUG_0ARG ("ITNP_NewStream return\n");
+  PLUGIN_DEBUG ("ITNP_NewStream\n");
+
+  PLUGIN_DEBUG ("ITNP_NewStream return\n");
 
   return NPERR_NO_ERROR;
 }
@@ -793,17 +793,17 @@
 void
 ITNP_StreamAsFile (NPP instance, NPStream* stream, const char* filename)
 {
-  PLUGIN_DEBUG_0ARG ("ITNP_StreamAsFile\n");
-
-  PLUGIN_DEBUG_0ARG ("ITNP_StreamAsFile return\n");
+  PLUGIN_DEBUG ("ITNP_StreamAsFile\n");
+
+  PLUGIN_DEBUG ("ITNP_StreamAsFile return\n");
 }
 
 NPError
 ITNP_DestroyStream (NPP instance, NPStream* stream, NPReason reason)
 {
-  PLUGIN_DEBUG_0ARG ("ITNP_DestroyStream\n");
-
-  PLUGIN_DEBUG_0ARG ("ITNP_DestroyStream return\n");
+  PLUGIN_DEBUG ("ITNP_DestroyStream\n");
+
+  PLUGIN_DEBUG ("ITNP_DestroyStream return\n");
 
   return NPERR_NO_ERROR;
 }
@@ -811,9 +811,9 @@
 int32_t
 ITNP_WriteReady (NPP instance, NPStream* stream)
 {
-  PLUGIN_DEBUG_0ARG ("ITNP_WriteReady\n");
-
-  PLUGIN_DEBUG_0ARG ("ITNP_WriteReady return\n");
+  PLUGIN_DEBUG ("ITNP_WriteReady\n");
+
+  PLUGIN_DEBUG ("ITNP_WriteReady return\n");
 
   return 0;
 }
@@ -822,9 +822,9 @@
 ITNP_Write (NPP instance, NPStream* stream, int32_t offset, int32_t len,
            void* buffer)
 {
-  PLUGIN_DEBUG_0ARG ("ITNP_Write\n");
-
-  PLUGIN_DEBUG_0ARG ("ITNP_Write return\n");
+  PLUGIN_DEBUG ("ITNP_Write\n");
+
+  PLUGIN_DEBUG ("ITNP_Write return\n");
 
   return 0;
 }
@@ -832,17 +832,17 @@
 void
 ITNP_Print (NPP instance, NPPrint* platformPrint)
 {
-  PLUGIN_DEBUG_0ARG ("ITNP_Print\n");
-
-  PLUGIN_DEBUG_0ARG ("ITNP_Print return\n");
+  PLUGIN_DEBUG ("ITNP_Print\n");
+
+  PLUGIN_DEBUG ("ITNP_Print return\n");
 }
 
 int16_t
 ITNP_HandleEvent (NPP instance, void* event)
 {
-  PLUGIN_DEBUG_0ARG ("ITNP_HandleEvent\n");
-
-  PLUGIN_DEBUG_0ARG ("ITNP_HandleEvent return\n");
+  PLUGIN_DEBUG ("ITNP_HandleEvent\n");
+
+  PLUGIN_DEBUG ("ITNP_HandleEvent return\n");
 
   return 0;
 }
@@ -851,9 +851,9 @@
 ITNP_URLNotify (NPP instance, const char* url, NPReason reason,
                void* notifyData)
 {
-  PLUGIN_DEBUG_0ARG ("ITNP_URLNotify\n");
-
-  PLUGIN_DEBUG_0ARG ("ITNP_URLNotify return\n");
+  PLUGIN_DEBUG ("ITNP_URLNotify\n");
+
+  PLUGIN_DEBUG ("ITNP_URLNotify return\n");
 }
 
 NPError
@@ -924,7 +924,7 @@
 static void
 plugin_data_new (ITNPPluginData** data)
 {
-  PLUGIN_DEBUG_0ARG ("plugin_data_new\n");
+  PLUGIN_DEBUG ("plugin_data_new\n");
 
   *data = (ITNPPluginData*)
     (*browser_functions.memalloc) (sizeof (struct ITNPPluginData));
@@ -933,7 +933,7 @@
   if (*data)
     memset (*data, 0, sizeof (struct ITNPPluginData));
 
-  PLUGIN_DEBUG_0ARG ("plugin_data_new return\n");
+  PLUGIN_DEBUG ("plugin_data_new return\n");
 }
 
 
@@ -948,7 +948,7 @@
 static gchar*
 plugin_get_documentbase (NPP instance)
 {
-  PLUGIN_DEBUG_0ARG ("plugin_get_documentbase\n");
+  PLUGIN_DEBUG ("plugin_get_documentbase\n");
 
   nsIPluginInstance* xpcom_instance = NULL;
   nsIPluginInstancePeer* peer = NULL;
@@ -1000,16 +1000,16 @@
   NS_RELEASE (peer);
 
  cleanup_done:
-  PLUGIN_DEBUG_0ARG ("plugin_get_documentbase return\n");
-
-  PLUGIN_DEBUG_1ARG("plugin_get_documentbase returning: %s\n", documentbase_copy);
+  PLUGIN_DEBUG ("plugin_get_documentbase return\n");
+
+  PLUGIN_DEBUG("plugin_get_documentbase returning: %s\n", documentbase_copy);
   return documentbase_copy;
 }
 #else
 static gchar*
 plugin_get_documentbase (NPP instance)
 {
-  PLUGIN_DEBUG_0ARG ("plugin_get_documentbase\n");
+  PLUGIN_DEBUG ("plugin_get_documentbase\n");
 
   char const* documentbase = NULL;
   gchar* documentbase_copy = NULL;
@@ -1053,8 +1053,8 @@
   browser_functions.releasevariantvalue(&href);
   browser_functions.releasevariantvalue(&location);
  cleanup_done:
-  PLUGIN_DEBUG_0ARG ("plugin_get_documentbase return\n");
-  PLUGIN_DEBUG_1ARG("plugin_get_documentbase returning: %s\n", documentbase_copy);
+  PLUGIN_DEBUG ("plugin_get_documentbase return\n");
+  PLUGIN_DEBUG("plugin_get_documentbase returning: %s\n", documentbase_copy);
 
   return documentbase_copy;
 }
@@ -1067,7 +1067,7 @@
 {
   GtkWidget* dialog = NULL;
 
-  PLUGIN_DEBUG_0ARG ("plugin_display_failure_dialog\n");
+  PLUGIN_DEBUG ("plugin_display_failure_dialog\n");
 
   dialog = gtk_message_dialog_new (NULL,
                                    GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -1079,7 +1079,7 @@
   gtk_dialog_run (GTK_DIALOG (dialog));
   gtk_widget_destroy (dialog);
 
-  PLUGIN_DEBUG_0ARG ("plugin_display_failure_dialog return\n");
+  PLUGIN_DEBUG ("plugin_display_failure_dialog return\n");
 }
 
 
@@ -1093,7 +1093,7 @@
                          GIOCondition condition,
                          gpointer plugin_data)
 {
-  PLUGIN_DEBUG_0ARG ("plugin_in_pipe_callback\n");
+  PLUGIN_DEBUG ("plugin_in_pipe_callback\n");
 
   gboolean keep_installed = TRUE;
 
@@ -1128,18 +1128,18 @@
 
   if (condition & (G_IO_ERR | G_IO_HUP))
     {
-      PLUGIN_DEBUG_0ARG ("appletviewer has stopped.\n");
+      PLUGIN_DEBUG ("appletviewer has stopped.\n");
       keep_installed = FALSE;
     }
 
-  PLUGIN_DEBUG_0ARG ("plugin_in_pipe_callback return\n");
+  PLUGIN_DEBUG ("plugin_in_pipe_callback return\n");
 
   return keep_installed;
 }
 
 void consume_message(gchar* message) {
 
-	PLUGIN_DEBUG_1ARG ("  PIPE: plugin read: %s\n", message);
+	PLUGIN_DEBUG ("  PIPE: plugin read: %s\n", message);
 
   if (g_str_has_prefix (message, "instance"))
     {
@@ -1154,7 +1154,7 @@
 
       if (instance_id > 0 && !instance)
         {
-          PLUGIN_DEBUG_2ARG("Instance %d is not active. Refusing to consume message \"%s\"\n", instance_id, message);
+          PLUGIN_DEBUG("Instance %d is not active. Refusing to consume message \"%s\"\n", instance_id, message);
           return;
         }
       else if (instance)
@@ -1168,8 +1168,8 @@
           gchar* decoded_url = (gchar*) calloc(strlen(parts[3]) + 1, sizeof(gchar));
           IcedTeaPluginUtilities::decodeURL(parts[3], &decoded_url);
 
-          PLUGIN_DEBUG_1ARG ("plugin_in_pipe_callback: opening URL %s\n", decoded_url);
-          PLUGIN_DEBUG_1ARG ("plugin_in_pipe_callback: URL target %s\n", parts[4]);
+          PLUGIN_DEBUG ("plugin_in_pipe_callback: opening URL %s\n", decoded_url);
+          PLUGIN_DEBUG ("plugin_in_pipe_callback: URL target %s\n", parts[4]);
 
           NPError np_error =
             (*browser_functions.geturl) (data->owner, decoded_url, parts[4]);
@@ -1191,7 +1191,7 @@
 
           // join the rest
           gchar* status_message = g_strjoinv(" ", parts);
-          PLUGIN_DEBUG_1ARG ("plugin_in_pipe_callback: setting status %s\n", status_message);
+          PLUGIN_DEBUG ("plugin_in_pipe_callback: setting status %s\n", status_message);
           (*browser_functions.status) (data->owner, status_message);
 
           g_free(status_message);
@@ -1227,7 +1227,7 @@
 
         gchar* decoded_url = (gchar*) calloc(strlen(parts[4]) + 1, sizeof(gchar));
         IcedTeaPluginUtilities::decodeURL(parts[4], &decoded_url);
-        PLUGIN_DEBUG_5ARG("parts[0]=%s, parts[1]=%s, reference, parts[3]=%s, parts[4]=%s -- decoded_url=%s\n", parts[0], parts[1], parts[3], parts[4], decoded_url);
+        PLUGIN_DEBUG("parts[0]=%s, parts[1]=%s, reference, parts[3]=%s, parts[4]=%s -- decoded_url=%s\n", parts[0], parts[1], parts[3], parts[4], decoded_url);
 
         gchar* proxy_info;
 
@@ -1241,7 +1241,7 @@
             proxy_info = g_strconcat (proxy_info, proxy, NULL);
           }
 
-        PLUGIN_DEBUG_1ARG("Proxy info: %s\n", proxy_info);
+        PLUGIN_DEBUG("Proxy info: %s\n", proxy_info);
         plugin_send_message_to_appletviewer(proxy_info);
 
         g_free(decoded_url);
@@ -1267,7 +1267,7 @@
             cookie_info = g_strconcat (cookie_info, cookie_string, NULL);
         }
 
-        PLUGIN_DEBUG_1ARG("Cookie info: %s\n", cookie_info);
+        PLUGIN_DEBUG("Cookie info: %s\n", cookie_info);
         plugin_send_message_to_appletviewer(cookie_info);
 
         g_free(decoded_url);
@@ -1292,7 +1292,7 @@
 {
     int id = GPOINTER_TO_INT(g_hash_table_lookup(instance_to_id_map,
                                                        instance));
-    PLUGIN_DEBUG_2ARG("Returning id %d for instance %p\n", id, instance);
+    PLUGIN_DEBUG("Returning id %d for instance %p\n", id, instance);
     return id;
 }
 
@@ -1327,7 +1327,7 @@
 
   // if there is no proxy found, return immediately
   if (!info) {
-     PLUGIN_DEBUG_1ARG("%s does not need a proxy\n", siteAddr);
+     PLUGIN_DEBUG("%s does not need a proxy\n", siteAddr);
      return NPERR_GENERIC_ERROR;
   }
 
@@ -1365,7 +1365,7 @@
 
   *len = strlen(*proxy);
 
-  PLUGIN_DEBUG_2ARG("Proxy info for %s: %s\n", siteAddr, *proxy);
+  PLUGIN_DEBUG("Proxy info for %s: %s\n", siteAddr, *proxy);
 
 #else
 
@@ -1398,13 +1398,13 @@
                           GIOCondition condition,
                           gpointer plugin_data)
 {
-  PLUGIN_DEBUG_0ARG ("plugin_out_pipe_callback\n");
+  PLUGIN_DEBUG ("plugin_out_pipe_callback\n");
 
   ITNPPluginData* data = (ITNPPluginData*) plugin_data;
 
-  PLUGIN_DEBUG_0ARG ("plugin_out_pipe_callback: appletviewer has stopped.\n");
-
-  PLUGIN_DEBUG_0ARG ("plugin_out_pipe_callback return\n");
+  PLUGIN_DEBUG ("plugin_out_pipe_callback: appletviewer has stopped.\n");
+
+  PLUGIN_DEBUG ("plugin_out_pipe_callback return\n");
 
   return FALSE;
 }
@@ -1447,12 +1447,12 @@
 
   if (path_new == NULL || strlen (path_new) == 0)
     {
-      PLUGIN_DEBUG_0ARG("Unset LD_LIBRARY_PATH\n");
+      PLUGIN_DEBUG("Unset LD_LIBRARY_PATH\n");
       return NULL;
     }
   else
     {
-      PLUGIN_DEBUG_1ARG ("Set LD_LIBRARY_PATH: %s\n", path_new);
+      PLUGIN_DEBUG ("Set LD_LIBRARY_PATH: %s\n", path_new);
       return path_new;
     }
 }
@@ -1484,7 +1484,7 @@
 static NPError
 plugin_test_appletviewer ()
 {
-  PLUGIN_DEBUG_1ARG ("plugin_test_appletviewer: %s\n", appletviewer_executable);
+  PLUGIN_DEBUG ("plugin_test_appletviewer: %s\n", appletviewer_executable);
   NPError error = NPERR_NO_ERROR;
 
   gchar* command_line[3] = { NULL, NULL, NULL };
@@ -1521,14 +1521,14 @@
   g_free (command_line[2]);
   command_line[2] = NULL;
 
-  PLUGIN_DEBUG_0ARG ("plugin_test_appletviewer return\n");
+  PLUGIN_DEBUG ("plugin_test_appletviewer return\n");
   return error;
 }
 
 static NPError
 plugin_start_appletviewer (ITNPPluginData* data)
 {
-  PLUGIN_DEBUG_0ARG ("plugin_start_appletviewer\n");
+  PLUGIN_DEBUG ("plugin_start_appletviewer\n");
   NPError error = NPERR_NO_ERROR;
 
   gchar** command_line;
@@ -1597,12 +1597,12 @@
 
   if (appletviewer_pid)
     {
-      PLUGIN_DEBUG_1ARG("Initialized VM with pid=%d\n", appletviewer_pid);
+      PLUGIN_DEBUG("Initialized VM with pid=%d\n", appletviewer_pid);
       appletviewer_watch_id = g_child_watch_add(appletviewer_pid, (GChildWatchFunc) appletviewer_monitor, (gpointer) appletviewer_pid);
     }
 
 
-  PLUGIN_DEBUG_0ARG ("plugin_start_appletviewer return\n");
+  PLUGIN_DEBUG ("plugin_start_appletviewer return\n");
   return error;
 }
 
@@ -1611,7 +1611,7 @@
 static gchar*
 plugin_create_applet_tag (int16_t argc, char* argn[], char* argv[])
 {
-  PLUGIN_DEBUG_0ARG ("plugin_create_applet_tag\n");
+  PLUGIN_DEBUG ("plugin_create_applet_tag\n");
 
   gchar* applet_tag = g_strdup ("<EMBED ");
   gchar* parameters = g_strdup ("");
@@ -1710,7 +1710,7 @@
   g_free (parameters);
   parameters = NULL;
 
-  PLUGIN_DEBUG_0ARG ("plugin_create_applet_tag return\n");
+  PLUGIN_DEBUG ("plugin_create_applet_tag return\n");
 
   return applet_tag;
 }
@@ -1720,7 +1720,7 @@
 void
 plugin_send_message_to_appletviewer (gchar const* message)
 {
-  PLUGIN_DEBUG_0ARG ("plugin_send_message_to_appletviewer\n");
+  PLUGIN_DEBUG ("plugin_send_message_to_appletviewer\n");
 
   if (jvm_up)
     {
@@ -1765,10 +1765,10 @@
       g_free (newline_message);
       newline_message = NULL;
 
-      PLUGIN_DEBUG_1ARG ("  PIPE: plugin wrote: %s\n", message);
+      PLUGIN_DEBUG ("  PIPE: plugin wrote: %s\n", message);
     }
 
-  PLUGIN_DEBUG_0ARG ("plugin_send_message_to_appletviewer return\n");
+  PLUGIN_DEBUG ("plugin_send_message_to_appletviewer return\n");
 }
 
 // Stop the appletviewer process.  When this is called the
@@ -1787,7 +1787,7 @@
 static void
 plugin_stop_appletviewer ()
 {
-  PLUGIN_DEBUG_0ARG ("plugin_stop_appletviewer\n");
+  PLUGIN_DEBUG ("plugin_stop_appletviewer\n");
 
   if (jvm_up)
     {
@@ -1863,21 +1863,21 @@
   jvm_up = FALSE;
   sleep(2); /* Needed to prevent crashes during debug (when JDWP port is not freed by the kernel right away) */
 
-  PLUGIN_DEBUG_0ARG ("plugin_stop_appletviewer return\n");
+  PLUGIN_DEBUG ("plugin_stop_appletviewer return\n");
 }
 
 static void appletviewer_monitor(GPid pid, gint status, gpointer data)
 {
-    PLUGIN_DEBUG_0ARG ("appletviewer_monitor\n");
+    PLUGIN_DEBUG ("appletviewer_monitor\n");
     jvm_up = FALSE;
     pid = -1;
-    PLUGIN_DEBUG_0ARG ("appletviewer_monitor return\n");
+    PLUGIN_DEBUG ("appletviewer_monitor return\n");
 }
 
 static void
 plugin_data_destroy (NPP instance)
 {
-  PLUGIN_DEBUG_0ARG ("plugin_data_destroy\n");
+  PLUGIN_DEBUG ("plugin_data_destroy\n");
 
   ITNPPluginData* tofree = (ITNPPluginData*) instance->pdata;
 
@@ -1912,7 +1912,7 @@
   (*browser_functions.memfree) (tofree);
   tofree = NULL;
 
-  PLUGIN_DEBUG_0ARG ("plugin_data_destroy return\n");
+  PLUGIN_DEBUG ("plugin_data_destroy return\n");
 }
 
 // FACTORY FUNCTIONS
@@ -1929,7 +1929,7 @@
 NPError
 NP_Initialize (NPNetscapeFuncs* browserTable, NPPluginFuncs* pluginTable)
 {
-  PLUGIN_DEBUG_0ARG ("NP_Initialize\n");
+  PLUGIN_DEBUG ("NP_Initialize\n");
 
   if (initialized)
     return NPERR_NO_ERROR;
@@ -2143,7 +2143,7 @@
 
   appletviewer_executable = g_strdup_printf ("%s/../../bin/java",
                                              dirname (filename));
-  PLUGIN_DEBUG_4ARG(".so is located at: %s and the link points to: %s. Executing java from dir %s to run %s\n", info.dli_fname, filename, dirname (filename), appletviewer_executable);
+  PLUGIN_DEBUG(".so is located at: %s and the link points to: %s. Executing java from dir %s to run %s\n", info.dli_fname, filename, dirname (filename), appletviewer_executable);
   if (!appletviewer_executable)
     {
       PLUGIN_ERROR ("Failed to create appletviewer executable name.");
@@ -2167,9 +2167,9 @@
 
   plugin_instance_mutex = g_mutex_new ();
 
-  PLUGIN_DEBUG_1ARG ("NP_Initialize: using %s\n", appletviewer_executable);
-
-  PLUGIN_DEBUG_0ARG ("NP_Initialize return\n");
+  PLUGIN_DEBUG ("NP_Initialize: using %s\n", appletviewer_executable);
+
+  PLUGIN_DEBUG ("NP_Initialize return\n");
 
   plugin_req_proc = new PluginRequestProcessor();
   java_req_proc = new JavaMessageSender();
@@ -2216,9 +2216,9 @@
 char*
 NP_GetMIMEDescription ()
 {
-  PLUGIN_DEBUG_0ARG ("NP_GetMIMEDescription\n");
-
-  PLUGIN_DEBUG_0ARG ("NP_GetMIMEDescription return\n");
+  PLUGIN_DEBUG ("NP_GetMIMEDescription\n");
+
+  PLUGIN_DEBUG ("NP_GetMIMEDescription return\n");
 
   return (char*) PLUGIN_MIME_DESC;
 }
@@ -2228,7 +2228,7 @@
 NPError
 NP_GetValue (void* future, NPPVariable variable, void* value)
 {
-  PLUGIN_DEBUG_0ARG ("NP_GetValue\n");
+  PLUGIN_DEBUG ("NP_GetValue\n");
 
   NPError result = NPERR_NO_ERROR;
   gchar** char_value = (gchar**) value;
@@ -2236,12 +2236,12 @@
   switch (variable)
     {
     case NPPVpluginNameString:
-      PLUGIN_DEBUG_0ARG ("NP_GetValue: returning plugin name.\n");
+      PLUGIN_DEBUG ("NP_GetValue: returning plugin name.\n");
       *char_value = g_strdup (PLUGIN_NAME);
       break;
 
     case NPPVpluginDescriptionString:
-      PLUGIN_DEBUG_0ARG ("NP_GetValue: returning plugin description.\n");
+      PLUGIN_DEBUG ("NP_GetValue: returning plugin description.\n");
       *char_value = g_strdup (PLUGIN_DESC);
       break;
 
@@ -2251,7 +2251,7 @@
       break;
     }
 
-  PLUGIN_DEBUG_0ARG ("NP_GetValue return\n");
+  PLUGIN_DEBUG ("NP_GetValue return\n");
 
   return result;
 }
@@ -2261,7 +2261,7 @@
 NPError
 NP_Shutdown (void)
 {
-  PLUGIN_DEBUG_0ARG ("NP_Shutdown\n");
+  PLUGIN_DEBUG ("NP_Shutdown\n");
 
   // Free mutex.
   if (plugin_instance_mutex)
@@ -2310,9 +2310,9 @@
 
   // cleanup_out_pipe:
   // Delete output pipe.
-  PLUGIN_DEBUG_1ARG ("NP_Shutdown: deleting output fifo: %s\n", out_pipe_name);
+  PLUGIN_DEBUG ("NP_Shutdown: deleting output fifo: %s\n", out_pipe_name);
   unlink (out_pipe_name);
-  PLUGIN_DEBUG_1ARG ("NP_Shutdown: deleted output fifo: %s\n", out_pipe_name);
+  PLUGIN_DEBUG ("NP_Shutdown: deleted output fifo: %s\n", out_pipe_name);
 
   // cleanup_out_pipe_name:
   g_free (out_pipe_name);
@@ -2320,9 +2320,9 @@
 
   // cleanup_in_pipe:
   // Delete input pipe.
-  PLUGIN_DEBUG_1ARG ("NP_Shutdown: deleting input fifo: %s\n", in_pipe_name);
+  PLUGIN_DEBUG ("NP_Shutdown: deleting input fifo: %s\n", in_pipe_name);
   unlink (in_pipe_name);
-  PLUGIN_DEBUG_1ARG ("NP_Shutdown: deleted input fifo: %s\n", in_pipe_name);
+  PLUGIN_DEBUG ("NP_Shutdown: deleted input fifo: %s\n", in_pipe_name);
 
   // cleanup_in_pipe_name:
   g_free (in_pipe_name);
@@ -2345,7 +2345,7 @@
   delete plugin_to_java_bus;
   //delete internal_bus;
 
-  PLUGIN_DEBUG_0ARG ("NP_Shutdown return\n");
+  PLUGIN_DEBUG ("NP_Shutdown return\n");
 
   return NPERR_NO_ERROR;
 }
@@ -2413,6 +2413,6 @@
 NPObject*
 allocate_scriptable_object(NPP npp, NPClass *aClass)
 {
-	PLUGIN_DEBUG_0ARG("Allocating new scriptable object\n");
+	PLUGIN_DEBUG("Allocating new scriptable object\n");
 	return new IcedTeaScriptablePluginObject(npp);
 }
--- a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc	Mon Jul 12 11:13:35 2010 -0400
+++ b/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc	Mon Jul 12 18:41:55 2010 -0400
@@ -73,7 +73,7 @@
 
 PluginRequestProcessor::~PluginRequestProcessor()
 {
-    PLUGIN_DEBUG_0ARG("PluginRequestProcessor::~PluginRequestProcessor\n");
+    PLUGIN_DEBUG("PluginRequestProcessor::~PluginRequestProcessor\n");
 
     if (pendingRequests)
         delete pendingRequests;
@@ -89,7 +89,7 @@
 bool
 PluginRequestProcessor::newMessageOnBus(const char* message)
 {
-    PLUGIN_DEBUG_1ARG("PluginRequestProcessor processing %s\n", message);
+    PLUGIN_DEBUG("PluginRequestProcessor processing %s\n", message);
 
     std::string* type;
     std::string* command;
@@ -169,7 +169,7 @@
     get_instance_from_id(id, instance);
 
     browser_functions.getvalue(instance, NPNVWindowNPObject, &window_ptr);
-    PLUGIN_DEBUG_3ARG("ID=%d, Instance=%p, WindowPTR = %p\n", id, instance, window_ptr);
+    PLUGIN_DEBUG("ID=%d, Instance=%p, WindowPTR = %p\n", id, instance, window_ptr);
 
     OBJECT_TO_NPVARIANT(window_ptr, *variant);
     browser_functions.retainobject(window_ptr);
@@ -592,7 +592,7 @@
     }
 #endif
 
-    PLUGIN_DEBUG_1ARG("Member PTR after internal request: %s\n", thread_data.result.c_str());
+    PLUGIN_DEBUG("Member PTR after internal request: %s\n", thread_data.result.c_str());
 
     java_result = java_request.findClass(0, "netscape.javascript.JSObject");
 
@@ -711,7 +711,7 @@
     std::string command;
     pthread_mutex_t wait_mutex = PTHREAD_MUTEX_INITIALIZER; // This is needed for API compat. and is unused
 
-    PLUGIN_DEBUG_1ARG("Queue processor initialized. Queue = %p\n", message_queue);
+    PLUGIN_DEBUG("Queue processor initialized. Queue = %p\n", message_queue);
 
     while (true)
     {
@@ -787,7 +787,7 @@
         message_parts = NULL;
     }
 
-    PLUGIN_DEBUG_0ARG("Queue processing stopped.\n");
+    PLUGIN_DEBUG("Queue processing stopped.\n");
 }
 
 /******************************************
@@ -810,7 +810,7 @@
     property = (NPIdentifier*) parameters.at(2);
     value = (std::string*) parameters.at(3);
 
-    PLUGIN_DEBUG_4ARG("Setting %s on instance %p, object %p to value %s\n", browser_functions.utf8fromidentifier(*property), instance, member, value->c_str());
+    PLUGIN_DEBUG("Setting %s on instance %p, object %p to value %s\n", browser_functions.utf8fromidentifier(*property), instance, member, value->c_str());
 
     IcedTeaPluginUtilities::javaResultToNPVariant(instance, value, &value_variant);
 
@@ -834,7 +834,7 @@
     NPIdentifier* member_identifier = (NPIdentifier*) parameters.at(2);
 
     // Get the NPVariant corresponding to this member
-    PLUGIN_DEBUG_4ARG("Looking for %p %p %p (%s)\n", instance, parent_ptr, member_identifier, browser_functions.utf8fromidentifier(*member_identifier));
+    PLUGIN_DEBUG("Looking for %p %p %p (%s)\n", instance, parent_ptr, member_identifier, browser_functions.utf8fromidentifier(*member_identifier));
 
     if (!browser_functions.hasproperty(instance, parent_ptr, *member_identifier))
     {
@@ -854,7 +854,7 @@
     // store member -> instance link
     IcedTeaPluginUtilities::storeInstanceID(member_ptr, instance);
 
-    PLUGIN_DEBUG_0ARG("_getMember returning.\n");
+    PLUGIN_DEBUG("_getMember returning.\n");
 }
 
 void
@@ -868,7 +868,7 @@
     NPVariant* eval_result = new NPVariant();
     std::string eval_result_ptr_str = std::string();
 
-    PLUGIN_DEBUG_0ARG("_eval called\n");
+    PLUGIN_DEBUG("_eval called\n");
 
     std::vector<void*>* call_data = (std::vector<void*>*) data;
 
@@ -880,12 +880,12 @@
     script.utf8characters = script_str->c_str();
     script.utf8length = script_str->size();
 
-    PLUGIN_DEBUG_1ARG("Evaluating: %s\n", script.utf8characters);
+    PLUGIN_DEBUG("Evaluating: %s\n", script.utf8characters);
 #else
     script.UTF8Characters = script_str->c_str();
     script.UTF8Length = script_str->size();
 
-    PLUGIN_DEBUG_1ARG("Evaluating: %s\n", script.UTF8Characters);
+    PLUGIN_DEBUG("Evaluating: %s\n", script.UTF8Characters);
 #endif
 
     ((AsyncCallThreadData*) data)->call_successful = browser_functions.evaluate(instance, window_ptr, &script, eval_result);
@@ -898,7 +898,7 @@
     }
     ((AsyncCallThreadData*) data)->result_ready = true;
 
-    PLUGIN_DEBUG_0ARG("_eval returning\n");
+    PLUGIN_DEBUG("_eval returning\n");
 }
 
 
@@ -914,7 +914,7 @@
     NPVariant* call_result = new NPVariant();
     std::string call_result_ptr_str = std::string();
 
-    PLUGIN_DEBUG_0ARG("_call called\n");
+    PLUGIN_DEBUG("_call called\n");
 
     std::vector<void*>* call_data = (std::vector<void*>*) data;
 
@@ -930,7 +930,9 @@
         IcedTeaPluginUtilities::printNPVariant(args[i]);
     }
 
+    PLUGIN_DEBUG("_calling\n");
     ((AsyncCallThreadData*) data)->call_successful = browser_functions.invoke(instance, window_ptr, function, args, *arg_count, call_result);
+    PLUGIN_DEBUG("_called\n");
 
     IcedTeaPluginUtilities::printNPVariant(*call_result);
 
@@ -942,7 +944,7 @@
 
     ((AsyncCallThreadData*) data)->result_ready = true;
 
-    PLUGIN_DEBUG_0ARG("_call returning\n");
+    PLUGIN_DEBUG("_call returning\n");
 }
 
 void
@@ -958,7 +960,7 @@
     instance = (NPP) call_data->at(0);
     NPVariant* variant = (NPVariant*) call_data->at(1);
 
-    PLUGIN_DEBUG_2ARG("_getString called with %p and %p\n", instance, variant);
+    PLUGIN_DEBUG("_getString called with %p and %p\n", instance, variant);
 
     if (NPVARIANT_IS_OBJECT(*variant))
     {
@@ -972,7 +974,7 @@
         ((AsyncCallThreadData*) data)->call_successful = true;
     }
 
-    PLUGIN_DEBUG_0ARG("ToString result: ");
+    PLUGIN_DEBUG("ToString result: ");
     IcedTeaPluginUtilities::printNPVariant(tostring_result);
 
     if (((AsyncCallThreadData*) data)->call_successful)
@@ -981,6 +983,6 @@
     }
     ((AsyncCallThreadData*) data)->result_ready = true;
 
-    PLUGIN_DEBUG_0ARG("_getString returning\n");
+    PLUGIN_DEBUG("_getString returning\n");
 }
 
--- a/plugin/icedteanp/IcedTeaPluginUtils.cc	Mon Jul 12 11:13:35 2010 -0400
+++ b/plugin/icedteanp/IcedTeaPluginUtils.cc	Mon Jul 12 18:41:55 2010 -0400
@@ -157,7 +157,7 @@
 
 	result->append(id_str);
 
-	PLUGIN_DEBUG_2ARG("Converting pointer %p to %s\n", id, id_str);
+	PLUGIN_DEBUG("Converting pointer %p to %s\n", id, id_str);
 	free(id_str);
 }
 
@@ -174,15 +174,15 @@
 	void* ptr;
 	if (sizeof(void*) == sizeof(long long))
 	{
-		PLUGIN_DEBUG_2ARG("Casting (long long) \"%s\" -- %llu\n", id_str.c_str(), strtoull(id_str.c_str(), NULL, 0));
+		PLUGIN_DEBUG("Casting (long long) \"%s\" -- %llu\n", id_str.c_str(), strtoull(id_str.c_str(), NULL, 0));
 		ptr = reinterpret_cast <void*> ((unsigned long long) strtoull(id_str.c_str(), NULL, 0));
 	} else
 	{
-		PLUGIN_DEBUG_2ARG("Casting (long) \"%s\" -- %lu\n", id_str.c_str(), strtoul(id_str.c_str(), NULL, 0));
+		PLUGIN_DEBUG("Casting (long) \"%s\" -- %lu\n", id_str.c_str(), strtoul(id_str.c_str(), NULL, 0));
 		ptr = reinterpret_cast <void*> ((unsigned long)  strtoul(id_str.c_str(), NULL, 0));
 	}
 
-	PLUGIN_DEBUG_1ARG("Casted: %p\n", ptr);
+	PLUGIN_DEBUG("Casted: %p\n", ptr);
 
 	return ptr;
 }
@@ -200,15 +200,15 @@
     void* ptr;
     if (sizeof(void*) == sizeof(long long))
     {
-        PLUGIN_DEBUG_2ARG("Casting (long long) \"%s\" -- %llu\n", id_str->c_str(), strtoull(id_str->c_str(), NULL, 0));
+        PLUGIN_DEBUG("Casting (long long) \"%s\" -- %llu\n", id_str->c_str(), strtoull(id_str->c_str(), NULL, 0));
         ptr = reinterpret_cast <void*> ((unsigned long long) strtoull(id_str->c_str(), NULL, 0));
     } else
     {
-        PLUGIN_DEBUG_2ARG("Casting (long) \"%s\" -- %lu\n", id_str->c_str(), strtoul(id_str->c_str(), NULL, 0));
+        PLUGIN_DEBUG("Casting (long) \"%s\" -- %lu\n", id_str->c_str(), strtoul(id_str->c_str(), NULL, 0));
         ptr = reinterpret_cast <void*> ((unsigned long)  strtoul(id_str->c_str(), NULL, 0));
     }
 
-    PLUGIN_DEBUG_1ARG("Casted: %p\n", ptr);
+    PLUGIN_DEBUG("Casted: %p\n", ptr);
 
     return ptr;
 }
@@ -344,7 +344,7 @@
 	for (int i = begin; i < begin+length; i++)
 	    result_unicode_str->push_back((char) strtol(unicode_byte_array->at(i)->c_str(), NULL, 16));
 
-	PLUGIN_DEBUG_2ARG("Converted UTF-8 string: %s. Length=%d\n", result_unicode_str->c_str(), result_unicode_str->length());
+	PLUGIN_DEBUG("Converted UTF-8 string: %s. Length=%d\n", result_unicode_str->c_str(), result_unicode_str->length());
 }
 
 /**
@@ -381,7 +381,7 @@
 	*utf_str = ostream.str();
 
 	free(hex_value);
-	PLUGIN_DEBUG_2ARG("Converted %s to UTF-8 string %s\n", str->c_str(), utf_str->c_str());
+	PLUGIN_DEBUG("Converted %s to UTF-8 string %s\n", str->c_str(), utf_str->c_str());
 }
 
 /**
@@ -451,7 +451,7 @@
 
 	*str += " }";
 
-	PLUGIN_DEBUG_2ARG("%s %s\n", prefix, str->c_str());
+	PLUGIN_DEBUG("%s %s\n", prefix, str->c_str());
 
 	delete str;
 }
@@ -483,7 +483,7 @@
 void
 IcedTeaPluginUtilities::storeInstanceID(void* member_ptr, NPP instance)
 {
-    PLUGIN_DEBUG_2ARG("Storing instance %p with key %p\n", instance, member_ptr);
+    PLUGIN_DEBUG("Storing instance %p with key %p\n", instance, member_ptr);
     instance_map->insert(std::make_pair(member_ptr, instance));
 }
 
@@ -496,7 +496,7 @@
 void
 IcedTeaPluginUtilities::removeInstanceID(void* member_ptr)
 {
-    PLUGIN_DEBUG_1ARG("Removing key %p from instance map\n", member_ptr);
+    PLUGIN_DEBUG("Removing key %p from instance map\n", member_ptr);
     instance_map->erase(member_ptr);
 }
 
@@ -506,7 +506,7 @@
 void
 IcedTeaPluginUtilities::invalidateInstance(NPP instance)
 {
-    PLUGIN_DEBUG_1ARG("Invalidating instance %p\n", instance);
+    PLUGIN_DEBUG("Invalidating instance %p\n", instance);
 
     std::map<void*,NPP>::iterator iterator;
 
@@ -531,14 +531,14 @@
 {
 
     NPP instance = NULL;
-    PLUGIN_DEBUG_1ARG("getInstanceFromMemberPtr looking for %p\n", member_ptr);
+    PLUGIN_DEBUG("getInstanceFromMemberPtr looking for %p\n", member_ptr);
 
     std::map<void*, NPP>::iterator iterator = instance_map->find(member_ptr);
 
     if (iterator != instance_map->end())
     {
         instance = instance_map->find(member_ptr)->second;
-        PLUGIN_DEBUG_2ARG("getInstanceFromMemberPtr found %p. Instance = %p\n", member_ptr, instance);
+        PLUGIN_DEBUG("getInstanceFromMemberPtr found %p. Instance = %p\n", member_ptr, instance);
     }
 
     return instance;
@@ -556,7 +556,7 @@
 {
 
     NPObject* object = NULL;
-    PLUGIN_DEBUG_1ARG("getNPObjectFromJavaKey looking for %s\n", key.c_str());
+    PLUGIN_DEBUG("getNPObjectFromJavaKey looking for %s\n", key.c_str());
 
     std::map<std::string, NPObject*>::iterator iterator = object_map->find(key);
 
@@ -567,7 +567,7 @@
         if (getInstanceFromMemberPtr(mapped_object) != NULL)
         {
             object = mapped_object;
-            PLUGIN_DEBUG_2ARG("getNPObjectFromJavaKey found %s. NPObject = %p\n", key.c_str(), object);
+            PLUGIN_DEBUG("getNPObjectFromJavaKey found %s. NPObject = %p\n", key.c_str(), object);
         }
     }
 
@@ -584,7 +584,7 @@
 void
 IcedTeaPluginUtilities::storeObjectMapping(std::string key, NPObject* object)
 {
-    PLUGIN_DEBUG_2ARG("Storing object %p with key %s\n", object, key.c_str());
+    PLUGIN_DEBUG("Storing object %p with key %s\n", object, key.c_str());
     object_map->insert(std::make_pair(key, object));
 }
 
@@ -597,7 +597,7 @@
 void
 IcedTeaPluginUtilities::removeObjectMapping(std::string key)
 {
-    PLUGIN_DEBUG_1ARG("Removing key %s from object map\n", key.c_str());
+    PLUGIN_DEBUG("Removing key %s from object map\n", key.c_str());
     object_map->erase(key);
 }
 
@@ -627,7 +627,7 @@
 
 	*str += " }";
 
-	PLUGIN_DEBUG_2ARG("%s %s\n", prefix, str->c_str());
+	PLUGIN_DEBUG("%s %s\n", prefix, str->c_str());
 
 	delete str;
 }
@@ -641,35 +641,35 @@
 
     if (NPVARIANT_IS_VOID(variant))
     {
-    	PLUGIN_DEBUG_1ARG("VOID %d\n", variant);
+    	PLUGIN_DEBUG("VOID %d\n", variant);
     }
     else if (NPVARIANT_IS_NULL(variant))
     {
-    	PLUGIN_DEBUG_1ARG("NULL\n", variant);
+    	PLUGIN_DEBUG("NULL\n", variant);
     }
     else if (NPVARIANT_IS_BOOLEAN(variant))
     {
-    	PLUGIN_DEBUG_1ARG("BOOL: %d\n", NPVARIANT_TO_BOOLEAN(variant));
+    	PLUGIN_DEBUG("BOOL: %d\n", NPVARIANT_TO_BOOLEAN(variant));
     }
     else if (NPVARIANT_IS_INT32(variant))
     {
-    	PLUGIN_DEBUG_1ARG("INT32: %d\n", NPVARIANT_TO_INT32(variant));
+    	PLUGIN_DEBUG("INT32: %d\n", NPVARIANT_TO_INT32(variant));
     }
     else if (NPVARIANT_IS_DOUBLE(variant))
     {
-    	PLUGIN_DEBUG_1ARG("DOUBLE: %f\n", NPVARIANT_TO_DOUBLE(variant));
+    	PLUGIN_DEBUG("DOUBLE: %f\n", NPVARIANT_TO_DOUBLE(variant));
     }
     else if (NPVARIANT_IS_STRING(variant))
     {
 #if MOZILLA_VERSION_COLLAPSED < 1090200
-    	PLUGIN_DEBUG_1ARG("STRING: %s\n", NPVARIANT_TO_STRING(variant).utf8characters);
+    	PLUGIN_DEBUG("STRING: %s\n", NPVARIANT_TO_STRING(variant).utf8characters);
 #else
-    	PLUGIN_DEBUG_1ARG("STRING: %s\n", NPVARIANT_TO_STRING(variant).UTF8Characters);
+    	PLUGIN_DEBUG("STRING: %s\n", NPVARIANT_TO_STRING(variant).UTF8Characters);
 #endif
     }
     else
     {
-    	PLUGIN_DEBUG_1ARG("OBJ: %p\n", NPVARIANT_TO_OBJECT(variant));
+    	PLUGIN_DEBUG("OBJ: %p\n", NPVARIANT_TO_OBJECT(variant));
     }
 }
 
@@ -738,19 +738,19 @@
 
         if (value == "void")
         {
-            PLUGIN_DEBUG_0ARG("Method call returned void\n");
+            PLUGIN_DEBUG("Method call returned void\n");
             VOID_TO_NPVARIANT(*variant);
         } else if (value == "null")
         {
-            PLUGIN_DEBUG_0ARG("Method call returned null\n");
+            PLUGIN_DEBUG("Method call returned null\n");
             NULL_TO_NPVARIANT(*variant);
         }else if (value == "true")
         {
-            PLUGIN_DEBUG_0ARG("Method call returned a boolean (true)\n");
+            PLUGIN_DEBUG("Method call returned a boolean (true)\n");
             BOOLEAN_TO_NPVARIANT(true, *variant);
         } else if (value == "false")
         {
-            PLUGIN_DEBUG_0ARG("Method call returned a boolean (false)\n");
+            PLUGIN_DEBUG("Method call returned a boolean (false)\n");
             BOOLEAN_TO_NPVARIANT(false, *variant);
         } else
         {
@@ -761,12 +761,12 @@
                 d < -(0x7fffffffL - 1L) ||
                 d > 0x7fffffffL)
             {
-                PLUGIN_DEBUG_1ARG("Method call returned a double %f\n", d);
+                PLUGIN_DEBUG("Method call returned a double %f\n", d);
                 DOUBLE_TO_NPVARIANT(d, *variant);
             } else
             {
                 int32_t i = (int32_t) d;
-                PLUGIN_DEBUG_1ARG("Method call returned an int %d\n", i);
+                PLUGIN_DEBUG("Method call returned an int %d\n", i);
                 INT32_TO_NPVARIANT(i, *variant);
             }
         }
@@ -803,7 +803,7 @@
             NPUTF8* return_str = (NPUTF8*) malloc(sizeof(NPUTF8)*java_result->return_string->size() + 1);
             strcpy(return_str, java_result->return_string->c_str());
 
-            PLUGIN_DEBUG_1ARG("Method call returned a string: \"%s\"\n", return_str);
+            PLUGIN_DEBUG("Method call returned a string: \"%s\"\n", return_str);
             STRINGZ_TO_NPVARIANT(return_str, *variant);
 
         } else {
@@ -865,7 +865,7 @@
     constructor_name.append(NPVARIANT_TO_STRING(constructor_str).UTF8Characters);
 #endif
 
-    PLUGIN_DEBUG_1ARG("Constructor for NPObject is %s\n", constructor_name.c_str());
+    PLUGIN_DEBUG("Constructor for NPObject is %s\n", constructor_name.c_str());
 
     return constructor_name.find("function Array") == 0;
 }
@@ -874,7 +874,7 @@
 IcedTeaPluginUtilities::decodeURL(const gchar* url, gchar** decoded_url)
 {
 
-    PLUGIN_DEBUG_2ARG("GOT URL: %s -- %s\n", url, *decoded_url);
+    PLUGIN_DEBUG("GOT URL: %s -- %s\n", url, *decoded_url);
     int length = strlen(url);
     for (int i=0; i < length; i++)
     {
@@ -903,7 +903,7 @@
         }
     }
 
-    PLUGIN_DEBUG_1ARG("SENDING URL: %s\n", *decoded_url);
+    PLUGIN_DEBUG("SENDING URL: %s\n", *decoded_url);
 }
 
 /******************************************
@@ -951,13 +951,13 @@
 	ret = pthread_mutex_init(&subscriber_mutex, NULL);
 
 	if(ret)
-		PLUGIN_DEBUG_1ARG("Error: Unable to initialize subscriber mutex: %d\n", ret);
+		PLUGIN_DEBUG("Error: Unable to initialize subscriber mutex: %d\n", ret);
 
 	ret = pthread_mutex_init(&msg_queue_mutex, NULL);
 	if(ret)
-		PLUGIN_DEBUG_1ARG("Error: Unable to initialize message queue mutex: %d\n", ret);
+		PLUGIN_DEBUG("Error: Unable to initialize message queue mutex: %d\n", ret);
 
-	PLUGIN_DEBUG_2ARG("Mutexs %p and %p initialized\n", &subscriber_mutex, &msg_queue_mutex);
+	PLUGIN_DEBUG("Mutexs %p and %p initialized\n", &subscriber_mutex, &msg_queue_mutex);
 }
 
 /**
@@ -968,17 +968,17 @@
 
 MessageBus::~MessageBus()
 {
-    PLUGIN_DEBUG_0ARG("MessageBus::~MessageBus\n");
+    PLUGIN_DEBUG("MessageBus::~MessageBus\n");
 
 	int ret;
 
 	ret = pthread_mutex_destroy(&subscriber_mutex);
 	if(ret)
-		PLUGIN_DEBUG_1ARG("Error: Unable to destroy subscriber mutex: %d\n", ret);
+		PLUGIN_DEBUG("Error: Unable to destroy subscriber mutex: %d\n", ret);
 
 	ret = pthread_mutex_destroy(&msg_queue_mutex);
 	if(ret)
-			PLUGIN_DEBUG_1ARG("Error: Unable to destroy message queue mutex: %d\n", ret);
+			PLUGIN_DEBUG("Error: Unable to destroy message queue mutex: %d\n", ret);
 }
 
 /**
@@ -991,7 +991,7 @@
 {
     // Applets may initialize in parallel. So lock before pushing.
 
-	PLUGIN_DEBUG_2ARG("Subscribing %p to bus %p\n", b, this);
+	PLUGIN_DEBUG("Subscribing %p to bus %p\n", b, this);
     pthread_mutex_lock(&subscriber_mutex);
     subscribers.push_back(b);
     pthread_mutex_unlock(&subscriber_mutex);
@@ -1007,7 +1007,7 @@
 {
     // Applets may initialize in parallel. So lock before pushing.
 
-	PLUGIN_DEBUG_2ARG("Un-subscribing %p from bus %p\n", b, this);
+	PLUGIN_DEBUG("Un-subscribing %p from bus %p\n", b, this);
     pthread_mutex_lock(&subscriber_mutex);
     subscribers.remove(b);
     pthread_mutex_unlock(&subscriber_mutex);
@@ -1027,21 +1027,21 @@
 	// consumer frees this memory
 	strcpy(msg, message);
 
-	PLUGIN_DEBUG_1ARG("Trying to lock %p...\n", &msg_queue_mutex);
+	PLUGIN_DEBUG("Trying to lock %p...\n", &msg_queue_mutex);
 	pthread_mutex_lock(&subscriber_mutex);
 
-    PLUGIN_DEBUG_1ARG("Message %s received on bus. Notifying subscribers.\n", msg);
+    PLUGIN_DEBUG("Message %s received on bus. Notifying subscribers.\n", msg);
 
     std::list<BusSubscriber*>::const_iterator i;
     for( i = subscribers.begin(); i != subscribers.end() && !message_consumed; ++i ) {
-    	PLUGIN_DEBUG_2ARG("Notifying subscriber %p of %s\n", *i, msg);
+    	PLUGIN_DEBUG("Notifying subscriber %p of %s\n", *i, msg);
     	message_consumed = ((BusSubscriber*) *i)->newMessageOnBus(msg);
     }
 
     pthread_mutex_unlock(&subscriber_mutex);
 
     if (!message_consumed)
-    	PLUGIN_DEBUG_1ARG("Warning: No consumer found for message %s\n", msg);
+    	PLUGIN_DEBUG("Warning: No consumer found for message %s\n", msg);
 
-    PLUGIN_DEBUG_1ARG("%p unlocked...\n", &msg_queue_mutex);
+    PLUGIN_DEBUG("%p unlocked...\n", &msg_queue_mutex);
 }
--- a/plugin/icedteanp/IcedTeaPluginUtils.h	Mon Jul 12 11:13:35 2010 -0400
+++ b/plugin/icedteanp/IcedTeaPluginUtils.h	Mon Jul 12 18:41:55 2010 -0400
@@ -66,65 +66,9 @@
 
 #include "IcedTeaNPPlugin.h"
 
-#define PLUGIN_DEBUG_0ARG(str) \
-  do                                        \
-  {                                         \
-    if (plugin_debug)                       \
-    {                                       \
-      fprintf(stderr, "ICEDTEA NP PLUGIN: "); \
-      fprintf(stderr, str);                \
-    }                                       \
-  } while (0)
-
-#define PLUGIN_DEBUG_1ARG(str, arg1) \
-  do                                        \
-  {                                         \
-    if (plugin_debug)                       \
-    {                                       \
-      fprintf(stderr, "ICEDTEA NP PLUGIN: "); \
-      fprintf(stderr, str, arg1);          \
-    }                                       \
-  } while (0)
-
-#define PLUGIN_DEBUG_2ARG(str, arg1, arg2)  \
-  do                                        \
-  {                                         \
-    if (plugin_debug)                       \
-    {                                       \
-      fprintf(stderr, "ICEDTEA NP PLUGIN: "); \
-      fprintf(stderr, str, arg1, arg2);    \
-    }                                       \
-  } while (0)
-
-#define PLUGIN_DEBUG_3ARG(str, arg1, arg2, arg3) \
-  do                                           \
-  {                                            \
-    if (plugin_debug)                          \
-    {                                          \
-      fprintf(stderr, "ICEDTEA NP PLUGIN: "); \
-      fprintf(stderr, str, arg1, arg2, arg3); \
-    }                                          \
-  } while (0)
-
-#define PLUGIN_DEBUG_4ARG(str, arg1, arg2, arg3, arg4) \
-  do                                                 \
-  {                                                  \
-    if (plugin_debug)                                \
-    {                                                \
-      fprintf(stderr, "ICEDTEA NP PLUGIN: "); \
-      fprintf(stderr, str, arg1, arg2, arg3, arg4); \
-    }                                                \
-  } while (0)
-
-#define PLUGIN_DEBUG_5ARG(str, arg1, arg2, arg3, arg4, arg5) \
-  do                                                 \
-  {                                                  \
-    if (plugin_debug)                                \
-    {                                                \
-      fprintf(stderr, "ICEDTEA NP PLUGIN: "); \
-      fprintf(stderr, str, arg1, arg2, arg3, arg4, arg5); \
-    }                                                \
-  } while (0)
+#define PLUGIN_DEBUG(...) \
+	fprintf (stderr, "ITNPP Thread# %d: ", pthread_self()); \
+	fprintf (stderr, __VA_ARGS__)
 
 #define CHECK_JAVA_RESULT(result_data)                               \
 {                                                                    \
--- a/plugin/icedteanp/IcedTeaScriptablePluginObject.cc	Mon Jul 12 11:13:35 2010 -0400
+++ b/plugin/icedteanp/IcedTeaScriptablePluginObject.cc	Mon Jul 12 18:41:55 2010 -0400
@@ -135,7 +135,7 @@
 NPObject*
 allocate_scriptable_jp_object(NPP npp, NPClass *aClass)
 {
-    PLUGIN_DEBUG_0ARG("Allocating new scriptable Java Package object\n");
+    PLUGIN_DEBUG("Allocating new scriptable Java Package object\n");
     return new IcedTeaScriptableJavaPackageObject(npp);
 }
 
@@ -161,7 +161,7 @@
 	np_class->construct = IcedTeaScriptableJavaPackageObject::construct;
 
 	scriptable_object = browser_functions.createobject(instance, np_class);
-	PLUGIN_DEBUG_3ARG("Returning new scriptable package class: %p from instance %p with name %s\n", scriptable_object, instance, name);
+	PLUGIN_DEBUG("Returning new scriptable package class: %p from instance %p with name %s\n", scriptable_object, instance, name);
 
     ((IcedTeaScriptableJavaPackageObject*) scriptable_object)->setPackageName(name);
 
@@ -172,7 +172,7 @@
 
 IcedTeaScriptableJavaPackageObject::IcedTeaScriptableJavaPackageObject(NPP instance)
 {
-    PLUGIN_DEBUG_0ARG("Constructing new scriptable java package object\n");
+    PLUGIN_DEBUG("Constructing new scriptable java package object\n");
 	this->instance = instance;
 	this->package_name = new std::string();
 }
@@ -232,7 +232,7 @@
 bool
 IcedTeaScriptableJavaPackageObject::hasProperty(NPObject *npobj, NPIdentifier name)
 {
-	PLUGIN_DEBUG_1ARG("IcedTeaScriptableJavaPackageObject::hasProperty %s\n", browser_functions.utf8fromidentifier(name));
+	PLUGIN_DEBUG("IcedTeaScriptableJavaPackageObject::hasProperty %s\n", browser_functions.utf8fromidentifier(name));
 
 	bool hasProperty = false;
 	JavaResultData* java_result;
@@ -240,7 +240,7 @@
     NPP instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj);
     int plugin_instance_id = get_id_from_instance(instance);
 
-	PLUGIN_DEBUG_1ARG("Object package name: \"%s\"\n", ((IcedTeaScriptableJavaPackageObject*) npobj)->getPackageName().c_str());
+	PLUGIN_DEBUG("Object package name: \"%s\"\n", ((IcedTeaScriptableJavaPackageObject*) npobj)->getPackageName().c_str());
 
 	// "^java" is always a package
 	if (((IcedTeaScriptableJavaPackageObject*) npobj)->getPackageName().length() == 0 &&
@@ -255,7 +255,7 @@
 	    property_name += ".";
 	property_name += browser_functions.utf8fromidentifier(name);
 
-	PLUGIN_DEBUG_1ARG("Looking for name \"%s\"\n", property_name.c_str());
+	PLUGIN_DEBUG("Looking for name \"%s\"\n", property_name.c_str());
 
 	java_result = java_request->hasPackage(plugin_instance_id, property_name);
 
@@ -278,7 +278,7 @@
 IcedTeaScriptableJavaPackageObject::getProperty(NPObject *npobj, NPIdentifier name, NPVariant *result)
 {
 
-	PLUGIN_DEBUG_1ARG("IcedTeaScriptableJavaPackageObject::getProperty %s\n", browser_functions.utf8fromidentifier(name));
+	PLUGIN_DEBUG("IcedTeaScriptableJavaPackageObject::getProperty %s\n", browser_functions.utf8fromidentifier(name));
 
 	if (!browser_functions.utf8fromidentifier(name))
 	    return false;
@@ -303,14 +303,14 @@
 
 	if (isPropertyClass)
 	{
-		PLUGIN_DEBUG_0ARG("Returning package object\n");
+		PLUGIN_DEBUG("Returning package object\n");
 		obj = IcedTeaScriptablePluginObject::get_scriptable_java_package_object(
                                   IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj),
                                   property_name.c_str());
 	}
 	else
 	{
-		PLUGIN_DEBUG_0ARG("Returning Java object\n");
+		PLUGIN_DEBUG("Returning Java object\n");
 		obj = IcedTeaScriptableJavaPackageObject::get_scriptable_java_object(
 		                IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj),
 		                *(java_result->return_string), "0", false);
@@ -353,7 +353,7 @@
 NPObject*
 allocate_scriptable_java_object(NPP npp, NPClass *aClass)
 {
-    PLUGIN_DEBUG_0ARG("Allocating new scriptable Java object\n");
+    PLUGIN_DEBUG("Allocating new scriptable Java object\n");
     return new IcedTeaScriptableJavaObject(npp);
 }
 
@@ -370,12 +370,12 @@
     obj_key += ":";
     obj_key += instance_id;
 
-    PLUGIN_DEBUG_1ARG("get_scriptable_java_object searching for %s...\n", obj_key.c_str());
+    PLUGIN_DEBUG("get_scriptable_java_object searching for %s...\n", obj_key.c_str());
     scriptable_object = IcedTeaPluginUtilities::getNPObjectFromJavaKey(obj_key);
 
     if (scriptable_object != NULL)
     {
-        PLUGIN_DEBUG_1ARG("Returning existing object %p\n", scriptable_object);
+        PLUGIN_DEBUG("Returning existing object %p\n", scriptable_object);
         browser_functions.retainobject(scriptable_object);
         return scriptable_object;
     }
@@ -420,7 +420,7 @@
         browser_functions.retainobject(scriptable_object);
     }
 
-    PLUGIN_DEBUG_4ARG("Constructed new Java Object with classid=%s, instanceid=%s, isArray=%d and scriptable_object=%p\n", class_id.c_str(), instance_id.c_str(), isArray, scriptable_object);
+    PLUGIN_DEBUG("Constructed new Java Object with classid=%s, instanceid=%s, isArray=%d and scriptable_object=%p\n", class_id.c_str(), instance_id.c_str(), isArray, scriptable_object);
 
 	((IcedTeaScriptableJavaObject*) scriptable_object)->setClassIdentifier(class_id);
     ((IcedTeaScriptableJavaObject*) scriptable_object)->setIsArray(isArray);
@@ -431,7 +431,7 @@
 	IcedTeaPluginUtilities::storeInstanceID(scriptable_object, instance);
 	IcedTeaPluginUtilities::storeObjectMapping(obj_key, scriptable_object);
 
-	PLUGIN_DEBUG_2ARG("Inserting into object_map key %s->%p\n", obj_key.c_str(), scriptable_object);
+	PLUGIN_DEBUG("Inserting into object_map key %s->%p\n", obj_key.c_str(), scriptable_object);
 	return scriptable_object;
 }
 
@@ -439,7 +439,7 @@
 void
 _createAndRetainJavaObject(void* data)
 {
-    PLUGIN_DEBUG_0ARG("Asynchronously creating/retaining object ...\n");
+    PLUGIN_DEBUG("Asynchronously creating/retaining object ...\n");
 
     std::vector<void*> parameters = ((AsyncCallThreadData*) data)->parameters;
     NPP instance = (NPP) parameters.at(0);
@@ -510,7 +510,7 @@
 bool
 IcedTeaScriptableJavaObject::hasMethod(NPObject *npobj, NPIdentifier name)
 {
-    PLUGIN_DEBUG_2ARG("IcedTeaScriptableJavaObject::hasMethod %s (ival=%d)\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
+    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::hasMethod %s (ival=%d)\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
     bool hasMethod = false;
 
     // If object is an array and requested "method" may be a number, check for it first
@@ -531,7 +531,7 @@
         hasMethod = java_result->return_identifier != 0;
     }
 
-    PLUGIN_DEBUG_1ARG("IcedTeaScriptableJavaObject::hasMethod returning %d\n", hasMethod);
+    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::hasMethod returning %d\n", hasMethod);
     return hasMethod;
 }
 
@@ -542,7 +542,7 @@
     NPUTF8* method_name = browser_functions.utf8fromidentifier(name);
 
     // Extract arg type array
-    PLUGIN_DEBUG_1ARG("IcedTeaScriptableJavaObject::invoke %s. Args follow.\n", method_name);
+    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::invoke %s. Args follow.\n", method_name);
     for (int i=0; i < argCount; i++)
     {
         IcedTeaPluginUtilities::printNPVariant(args[i]);
@@ -577,14 +577,14 @@
 
     if (instance_id.length() == 0) // Static
     {
-        PLUGIN_DEBUG_0ARG("Calling static method\n");
+        PLUGIN_DEBUG("Calling static method\n");
         callee = ((IcedTeaScriptableJavaObject*) npobj)->getClassID();
         java_result = java_request.callStaticMethod(
                         IcedTeaPluginUtilities::getSourceFromInstance(instance),
                         callee, browser_functions.utf8fromidentifier(name), arg_ids);
     } else
     {
-        PLUGIN_DEBUG_0ARG("Calling method normally\n");
+        PLUGIN_DEBUG("Calling method normally\n");
         callee = ((IcedTeaScriptableJavaObject*) npobj)->getInstanceID();
         java_result = java_request.callMethod(
                         IcedTeaPluginUtilities::getSourceFromInstance(instance),
@@ -600,7 +600,7 @@
         return false;
     }
 
-    PLUGIN_DEBUG_0ARG("IcedTeaScriptableJavaObject::invoke converting and returning.\n");
+    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::invoke converting and returning.\n");
     return IcedTeaPluginUtilities::javaResultToNPVariant(instance, java_result->return_string, result);
 }
 
@@ -615,7 +615,7 @@
 bool
 IcedTeaScriptableJavaObject::hasProperty(NPObject *npobj, NPIdentifier name)
 {
-    PLUGIN_DEBUG_2ARG("IcedTeaScriptableJavaObject::hasProperty %s (ival=%d)\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
+    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::hasProperty %s (ival=%d)\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
     bool hasProperty = false;
 
     // If it is an array, only length and indexes are valid
@@ -648,14 +648,14 @@
         }
     }
 
-	PLUGIN_DEBUG_1ARG("IcedTeaScriptableJavaObject::hasProperty returning %d\n", hasProperty);
+	PLUGIN_DEBUG("IcedTeaScriptableJavaObject::hasProperty returning %d\n", hasProperty);
 	return hasProperty;
 }
 
 bool
 IcedTeaScriptableJavaObject::getProperty(NPObject *npobj, NPIdentifier name, NPVariant *result)
 {
-    PLUGIN_DEBUG_2ARG("IcedTeaScriptableJavaObject::getProperty %s (ival=%d)\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
+    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::getProperty %s (ival=%d)\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
 
     bool isPropertyClass = false;
     JavaResultData* java_result;
@@ -730,14 +730,14 @@
         return false;
     }
 
-    PLUGIN_DEBUG_0ARG("IcedTeaScriptableJavaObject::getProperty converting and returning.\n");
+    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::getProperty converting and returning.\n");
     return IcedTeaPluginUtilities::javaResultToNPVariant(instance, java_result->return_string, result);
 }
 
 bool
 IcedTeaScriptableJavaObject::setProperty(NPObject *npobj, NPIdentifier name, const NPVariant *value)
 {
-    PLUGIN_DEBUG_2ARG("IcedTeaScriptableJavaObject::setProperty %s (ival=%d) to:\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
+    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::setProperty %s (ival=%d) to:\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
     IcedTeaPluginUtilities::printNPVariant(*value);
 
     bool isPropertyClass = false;
@@ -811,7 +811,7 @@
         return false;
     }
 
-    PLUGIN_DEBUG_0ARG("IcedTeaScriptableJavaObject::setProperty returning.\n");
+    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::setProperty returning.\n");
     return true;
 }
 
@@ -834,7 +834,7 @@
 	           NPVariant *result)
 {
     // Extract arg type array
-    PLUGIN_DEBUG_1ARG("IcedTeaScriptableJavaObject::construct %s. Args follow.\n", ((IcedTeaScriptableJavaObject*) npobj)->getClassID().c_str());
+    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::construct %s. Args follow.\n", ((IcedTeaScriptableJavaObject*) npobj)->getClassID().c_str());
     for (int i=0; i < argCount; i++)
     {
         IcedTeaPluginUtilities::printNPVariant(args[i]);
@@ -892,6 +892,6 @@
 
     OBJECT_TO_NPVARIANT(obj, *result);
 
-    PLUGIN_DEBUG_0ARG("IcedTeaScriptableJavaObject::construct returning.\n");
+    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::construct returning.\n");
     return true;
 }