Introduce common-debug.h
[deliverable/binutils-gdb.git] / gdb / common / agent.c
index 3f868badae768602cba72ef8ab77d78b72dbdfba..2963917641c10b2147d7f4c647ec6c4d333dbf38 100644 (file)
 
 int debug_agent = 0;
 
-#ifdef GDBSERVER
-#define DEBUG_AGENT(fmt, args...)      \
-  if (debug_agent)                     \
-    fprintf (stderr, fmt, ##args);
-#else
-#define DEBUG_AGENT(fmt, args...)      \
-  if (debug_agent)                     \
-    fprintf_unfiltered (gdb_stdlog, fmt, ##args);
-#endif
+/* A stdarg wrapper for debug_vprintf.  */
+
+static void ATTRIBUTE_PRINTF (1, 2)
+debug_agent_printf (const char *fmt, ...)
+{
+  va_list ap;
+
+  if (!debug_agent)
+    return;
+  va_start (ap, fmt);
+  debug_vprintf (fmt, ap);
+  va_end (ap);
+}
+
+#define DEBUG_AGENT debug_agent_printf
 
 /* Global flag to determine using agent or not.  */
 int use_agent = 0;
This page took 0.03041 seconds and 4 git commands to generate.