Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mircea Gherzan <mircea.gherzan@intel.com>
To: tromey@redhat.com, palves@redhat.com, jan.kratochvil@redhat.com
Cc: gdb-patches@sourceware.org, Mircea Gherzan <mircea.gherzan@intel.com>
Subject: [PATCH 2/7] gdbserver, common: convert some variadic macros to C99
Date: Thu, 27 Jun 2013 08:44:00 -0000	[thread overview]
Message-ID: <1372322622-3216-3-git-send-email-mircea.gherzan@intel.com> (raw)
In-Reply-To: <1372322622-3216-1-git-send-email-mircea.gherzan@intel.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


  parent reply	other threads:[~2013-06-27  8:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-27  8:44 [PATCH 0/7] increase the portability of the gdbserver code Mircea Gherzan
2013-06-27  8:44 ` [PATCH 3/7] gdbserver: avoid empty structs when not using GCC Mircea Gherzan
2013-06-28 16:04   ` Tom Tromey
2013-06-27  8:44 ` Mircea Gherzan [this message]
2013-06-28 16:02   ` [PATCH 2/7] gdbserver, common: convert some variadic macros to C99 Tom Tromey
2013-06-27  8:44 ` [PATCH 1/7] gdbserver, common: conditionally include the unistd.h Mircea Gherzan
2013-06-27 13:29   ` Pedro Alves
2013-06-27 19:19     ` Pedro Alves
2013-06-28 15:16       ` Mircea Gherzan
2013-06-28 18:26         ` Pedro Alves
2013-07-01 11:32           ` Pedro Alves
2013-06-27  8:44 ` [PATCH 6/7] common: add an alternative implementation for xstrvprintf Mircea Gherzan
2013-07-29 19:16   ` Tom Tromey
2013-06-27  8:44 ` [PATCH 4/7] gdbserver: conditionally include sys/param.h and sys/time.h Mircea Gherzan
2013-06-28 16:34   ` Tom Tromey
2013-07-02 14:46     ` Mircea Gherzan
2013-06-27  8:45 ` [PATCH 7/7] gdbserver: add fallback implementation for memmem Mircea Gherzan
2013-06-27 19:27   ` Pedro Alves
2013-06-28 15:18     ` Mircea Gherzan
2013-06-27 11:32 ` [PATCH 5/7] gdbserver, win32: fix some function typedefs Mircea Gherzan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1372322622-3216-3-git-send-email-mircea.gherzan@intel.com \
    --to=mircea.gherzan@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=palves@redhat.com \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox