This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 2/7] gdbserver, common: convert some variadic macros to C99
- From: Mircea Gherzan <mircea dot gherzan at intel dot com>
- To: tromey at redhat dot com, palves at redhat dot com, jan dot kratochvil at redhat dot com
- Cc: gdb-patches at sourceware dot org, Mircea Gherzan <mircea dot gherzan at intel dot com>
- Date: Thu, 27 Jun 2013 10:43:37 +0200
- Subject: [PATCH 2/7] gdbserver, common: convert some variadic macros to C99
- References: <1372322622-3216-1-git-send-email-mircea dot gherzan at intel dot com>
2013-06-25 Mircea Gherzan <mircea.gherzan@intel.com>
* common/agent.c (DEBUG_AGENT): convert to __VA_ARGS__.
gdbserver/
* ax.c (ax_debug): Convert to __VA_ARGS__.
(ax_debug_1): Convert to __VA_ARGS__.
* tracepoint.c (trace_debug): Convert to __VA_ARGS__.
(trace_debug_1): Convert to __VA_ARGS__.
Signed-off-by: Mircea Gherzan <mircea.gherzan@intel.com>
---
gdb/common/agent.c | 8 ++++----
gdb/gdbserver/ax.c | 12 ++++++------
gdb/gdbserver/tracepoint.c | 10 +++++-----
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/gdb/common/agent.c b/gdb/common/agent.c
index bbf5c4c..f0759b5 100644
--- a/gdb/common/agent.c
+++ b/gdb/common/agent.c
@@ -35,13 +35,13 @@
int debug_agent = 0;
#ifdef GDBSERVER
-#define DEBUG_AGENT(fmt, args...) \
+#define DEBUG_AGENT(...) \
if (debug_agent) \
- fprintf (stderr, fmt, ##args);
+ fprintf (stderr, __VA_ARGS__);
#else
-#define DEBUG_AGENT(fmt, args...) \
+#define DEBUG_AGENT(...) \
if (debug_agent) \
- fprintf_unfiltered (gdb_stdlog, fmt, ##args);
+ fprintf_unfiltered (gdb_stdlog, __VA_ARGS__);
#endif
/* Global flag to determine using agent or not. */
diff --git a/gdb/gdbserver/ax.c b/gdb/gdbserver/ax.c
index b6824a2..71145c1 100644
--- a/gdb/gdbserver/ax.c
+++ b/gdb/gdbserver/ax.c
@@ -38,14 +38,14 @@ ax_vdebug (const char *fmt, ...)
va_end (ap);
}
-#define ax_debug_1(level, fmt, args...) \
- do { \
- if (level <= debug_threads) \
- ax_vdebug ((fmt), ##args); \
+#define ax_debug_1(level, ...) \
+ do { \
+ if (level <= debug_threads) \
+ ax_vdebug (__VA_ARGS__); \
} while (0)
-#define ax_debug(FMT, args...) \
- ax_debug_1 (1, FMT, ##args)
+#define ax_debug(...) \
+ ax_debug_1 (1, __VA_ARGS__)
/* This enum must exactly match what is documented in
gdb/doc/agentexpr.texi, including all the numerical values. */
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index c0dea5b..392f84b 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -76,14 +76,14 @@ trace_vdebug (const char *fmt, ...)
va_end (ap);
}
-#define trace_debug_1(level, fmt, args...) \
- do { \
+#define trace_debug_1(level, ...) \
+ do { \
if (level <= debug_threads) \
- trace_vdebug ((fmt), ##args); \
+ trace_vdebug (__VA_ARGS__); \
} while (0)
-#define trace_debug(FMT, args...) \
- trace_debug_1 (1, FMT, ##args)
+#define trace_debug(...) \
+ trace_debug_1 (1, __VA_ARGS__)
#if defined(__GNUC__)
# define ATTR_USED __attribute__((used))
--
1.7.12.4