gdb: Support printf 'z' size modifier
[deliverable/binutils-gdb.git] / gdb / gdbserver / ax.c
index a16fba1ccd73c50950d1be638a6c1a24b39402eb..21fde5e6926843a0f0ed0499cc5c352556bdc543 100644 (file)
@@ -18,9 +18,9 @@
 
 #include "server.h"
 #include "ax.h"
-#include "common/format.h"
+#include "gdbsupport/format.h"
 #include "tracepoint.h"
-#include "common/rsp-low.h"
+#include "gdbsupport/rsp-low.h"
 
 static void ax_vdebug (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
 
@@ -36,7 +36,11 @@ ax_vdebug (const char *fmt, ...)
 
   va_start (ap, fmt);
   vsprintf (buf, fmt, ap);
+#ifdef IN_PROCESS_AGENT
   fprintf (stderr, PROG "/ax: %s\n", buf);
+#else
+  debug_printf (PROG "/ax: %s\n", buf);
+#endif
   va_end (ap);
 }
 
@@ -56,7 +60,7 @@ enum gdb_agent_op
   {
 #define DEFOP(NAME, SIZE, DATA_SIZE, CONSUMED, PRODUCED, VALUE)  \
     gdb_agent_op_ ## NAME = VALUE,
-#include "common/ax.def"
+#include "gdbsupport/ax.def"
 #undef DEFOP
     gdb_agent_op_last
   };
@@ -65,7 +69,7 @@ static const char *gdb_agent_op_names [gdb_agent_op_last] =
   {
     "?undef?"
 #define DEFOP(NAME, SIZE, DATA_SIZE, CONSUMED, PRODUCED, VALUE)  , # NAME
-#include "common/ax.def"
+#include "gdbsupport/ax.def"
 #undef DEFOP
   };
 
@@ -74,7 +78,7 @@ static const unsigned char gdb_agent_op_sizes [gdb_agent_op_last] =
   {
     0
 #define DEFOP(NAME, SIZE, DATA_SIZE, CONSUMED, PRODUCED, VALUE)  , SIZE
-#include "common/ax.def"
+#include "gdbsupport/ax.def"
 #undef DEFOP
   };
 #endif
@@ -900,6 +904,14 @@ ax_printf (CORE_ADDR fn, CORE_ADDR chan, const char *format,
            break;
          }
 
+       case size_t_arg:
+         {
+           size_t val = args[i];
+
+           printf (current_substring, val);
+           break;
+         }
+
        case literal_piece:
          /* Print a portion of the format string that has no
             directives.  Note that this will not include any
This page took 0.027656 seconds and 4 git commands to generate.