Introduce show_debug_regs
[deliverable/binutils-gdb.git] / gdb / common / agent.c
index fdede74542ccb3930eff2707af1799b4d6022f7d..2963917641c10b2147d7f4c647ec6c4d333dbf38 100644 (file)
 #else
 #include "defs.h"
 #include "target.h"
-#include "inferior.h" /* for non_stop */
+#include "infrun.h"
+#include "objfiles.h"
 #endif
-
-#include <string.h>
 #include <unistd.h>
 #include "agent.h"
 #include "filestuff.h"
 
 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;
@@ -103,7 +108,7 @@ agent_look_up_symbols (void *arg)
                               (struct objfile *) arg);
 
       if (sym.minsym != NULL)
-       *addrp = MSYMBOL_VALUE_ADDRESS (sym.minsym);
+       *addrp = BMSYMBOL_VALUE_ADDRESS (sym);
       else
 #endif
        {
This page took 0.023908 seconds and 4 git commands to generate.