Use gdb_printf and gdb_vprintf in more places
authorTom Tromey <tromey@adacore.com>
Wed, 30 Mar 2022 15:32:18 +0000 (09:32 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 30 Mar 2022 15:32:18 +0000 (09:32 -0600)
Luis pointed out that I missed a spot in the gdb_printf conversion --
namely aarch64-nat.c.  While looking at this, I found another spot in
darwin-nat.c that I also missed.  I can't build either of these, but I
think this patch should fix the problems.

gdb/aarch64-nat.c
gdb/darwin-nat.c

index 85cf7f2011a777c970c9788ea4f23cee86e4450a..cd86c384a0e89457d562c859b51a6aea708e1b30 100644 (file)
@@ -114,10 +114,9 @@ aarch64_insert_hw_breakpoint (struct gdbarch *gdbarch,
   gdbarch_breakpoint_from_pc (gdbarch, &addr, &len);
 
   if (show_debug_regs)
-    fprintf_unfiltered
-      (gdb_stdlog,
-       "insert_hw_breakpoint on entry (addr=0x%08lx, len=%d))\n",
-       (unsigned long) addr, len);
+    gdb_printf (gdb_stdlog,
+               "insert_hw_breakpoint on entry (addr=0x%08lx, len=%d))\n",
+               (unsigned long) addr, len);
 
   ret = aarch64_handle_breakpoint (type, addr, len, 1 /* is_insert */,
                                   inferior_ptid, state);
@@ -148,9 +147,9 @@ aarch64_remove_hw_breakpoint (struct gdbarch *gdbarch,
   gdbarch_breakpoint_from_pc (gdbarch, &addr, &len);
 
   if (show_debug_regs)
-    fprintf_unfiltered
-      (gdb_stdlog, "remove_hw_breakpoint on entry (addr=0x%08lx, len=%d))\n",
-       (unsigned long) addr, len);
+    gdb_printf (gdb_stdlog,
+               "remove_hw_breakpoint on entry (addr=0x%08lx, len=%d))\n",
+               (unsigned long) addr, len);
 
   ret = aarch64_handle_breakpoint (type, addr, len, 0 /* is_insert */,
                                   inferior_ptid, state);
@@ -177,9 +176,9 @@ aarch64_insert_watchpoint (CORE_ADDR addr, int len, enum target_hw_bp_type type,
     = aarch64_get_debug_reg_state (inferior_ptid.pid ());
 
   if (show_debug_regs)
-    fprintf_unfiltered (gdb_stdlog,
-                       "insert_watchpoint on entry (addr=0x%08lx, len=%d)\n",
-                       (unsigned long) addr, len);
+    gdb_printf (gdb_stdlog,
+               "insert_watchpoint on entry (addr=0x%08lx, len=%d)\n",
+               (unsigned long) addr, len);
 
   gdb_assert (type != hw_execute);
 
@@ -208,9 +207,9 @@ aarch64_remove_watchpoint (CORE_ADDR addr, int len, enum target_hw_bp_type type,
     = aarch64_get_debug_reg_state (inferior_ptid.pid ());
 
   if (show_debug_regs)
-    fprintf_unfiltered (gdb_stdlog,
-                       "remove_watchpoint on entry (addr=0x%08lx, len=%d)\n",
-                       (unsigned long) addr, len);
+    gdb_printf (gdb_stdlog,
+               "remove_watchpoint on entry (addr=0x%08lx, len=%d)\n",
+               (unsigned long) addr, len);
 
   gdb_assert (type != hw_execute);
 
index 60d315b70636439d8f9b5c66c2f2f989deebe98b..17723656930e0b2458bee480cec4aa9c0ddd3385 100644 (file)
@@ -170,7 +170,7 @@ inferior_debug (int level, const char *fmt, ...)
 
   va_start (ap, fmt);
   gdb_printf (gdb_stdlog, _("[%d inferior]: "), getpid ());
-  vfprintf_unfiltered (gdb_stdlog, fmt, ap);
+  gdb_vprintf (gdb_stdlog, fmt, ap);
   va_end (ap);
 }