[PATCH 2/7] Use debug_prefixed_printf_cond_nofunc in microblaze.c
Tom Tromey
tom@tromey.com
Tue Dec 28 22:49:52 GMT 2021
This changes microblaze.c to use the standard logging macro. As a
side effect, logs will now go to gdb_stdlog. This is part of PR gdb/7233.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233
---
gdb/microblaze-tdep.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
index e50f50d2b8c..0a2cfa2f65c 100644
--- a/gdb/microblaze-tdep.c
+++ b/gdb/microblaze-tdep.c
@@ -82,19 +82,10 @@ static const char * const microblaze_register_names[] =
static unsigned int microblaze_debug_flag = 0;
-static void ATTRIBUTE_PRINTF (1, 2)
-microblaze_debug (const char *fmt, ...)
-{
- if (microblaze_debug_flag)
- {
- va_list args;
+#define microblaze_debug(fmt, ...) \
+ debug_prefixed_printf_cond_nofunc (microblaze_debug_flag, "MICROBLAZE", \
+ fmt, ## __VA_ARGS__)
- va_start (args, fmt);
- printf_unfiltered ("MICROBLAZE: ");
- vprintf_unfiltered (fmt, args);
- va_end (args);
- }
-}
/* Return the name of register REGNUM. */
--
2.31.1
More information about the Gdb-patches
mailing list