Introduce show_debug_regs
[deliverable/binutils-gdb.git] / gdb / common / agent.c
index 99cef4fcab354d67f18554ace50d709472881904..2963917641c10b2147d7f4c647ec6c4d333dbf38 100644 (file)
@@ -1,6 +1,6 @@
 /* Shared utility routines for GDB to interact with agent.
 
-   Copyright (C) 2009-2013 Free Software Foundation, Inc.
+   Copyright (C) 2009-2014 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #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;
@@ -98,12 +103,12 @@ agent_look_up_symbols (void *arg)
 
       if (look_up_one_symbol (symbol_list[i].name, addrp, 1) == 0)
 #else
-      struct minimal_symbol *sym =
+      struct bound_minimal_symbol sym =
        lookup_minimal_symbol (symbol_list[i].name, NULL,
                               (struct objfile *) arg);
 
-      if (sym != NULL)
-       *addrp = SYMBOL_VALUE_ADDRESS (sym);
+      if (sym.minsym != NULL)
+       *addrp = BMSYMBOL_VALUE_ADDRESS (sym);
       else
 #endif
        {
This page took 0.024465 seconds and 4 git commands to generate.