Fix crash with "maint print arc"
[binutils-gdb.git] / gdb / microblaze-tdep.c
index e50f50d2b8c28419bf833d419bd05ef46d5aa4f8..3d5dd66934131d7c8d49cec83928244a0e93d80a 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for Xilinx MicroBlaze.
 
-   Copyright (C) 2009-2021 Free Software Foundation, Inc.
+   Copyright (C) 2009-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -82,19 +82,10 @@ static const char * const microblaze_register_names[] =
 \f
 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);
-    }
-}
 \f
 /* Return the name of register REGNUM.  */