Remove some is_mi_like_p from breakpoint code
authorTom Tromey <tom@tromey.com>
Mon, 30 Apr 2018 02:52:26 +0000 (20:52 -0600)
committerTom Tromey <tom@tromey.com>
Mon, 30 Apr 2018 18:59:05 +0000 (12:59 -0600)
This removes some uses of is_mi_like_p from the breakpoint code.  The
break-catch-throw.c change brings it into line with what other
breakpoint classes do.  The other changes simply replace printf calls
with ui_out::text or ui_out::message calls.

ChangeLog
2018-04-30  Tom Tromey  <tom@tromey.com>

* breakpoint.c (mention): Remove use of is_mi_like_p.
(print_mention_ranged_breakpoint): Likewise.
* break-catch-throw.c (print_it_exception_catchpoint): Remove use
of is_mi_like_p.

gdb/ChangeLog
gdb/break-catch-throw.c
gdb/breakpoint.c

index 97260fb405237d229969ff7784ba8f41078164d8..f1da8fbec8959f6cd3d8130e8c1e0640aeb7e388 100644 (file)
@@ -1,3 +1,10 @@
+2018-04-30  Tom Tromey  <tom@tromey.com>
+
+       * breakpoint.c (mention): Remove use of is_mi_like_p.
+       (print_mention_ranged_breakpoint): Likewise.
+       * break-catch-throw.c (print_it_exception_catchpoint): Remove use
+       of is_mi_like_p.
+
 2018-04-30  Tom Tromey  <tom@tromey.com>
 
        * tracepoint.c (tvariables_info_1): Remove use of is_mi_like_p.
index a911ddd9b5e735914b18f2c7d30332e3095ab545..bdb552c8631618cba4429fc2f27ba50b55af6661 100644 (file)
@@ -238,8 +238,7 @@ print_it_exception_catchpoint (bpstat bs)
   bp_temp = b->disposition == disp_del;
   uiout->text (bp_temp ? "Temporary catchpoint "
                       : "Catchpoint ");
-  if (!uiout->is_mi_like_p ())
-    uiout->field_int ("bkptno", b->number);
+  uiout->field_int ("bkptno", b->number);
   uiout->text ((kind == EX_EVENT_THROW ? " (exception thrown), "
                : (kind == EX_EVENT_CATCH ? " (exception caught), "
                   : " (exception rethrown), ")));
@@ -248,7 +247,6 @@ print_it_exception_catchpoint (bpstat bs)
       uiout->field_string ("reason",
                           async_reason_lookup (EXEC_ASYNC_BREAKPOINT_HIT));
       uiout->field_string ("disp", bpdisp_text (b->disposition));
-      uiout->field_int ("bkptno", b->number);
     }
   return PRINT_SRC_AND_LOC;
 }
index b01961013053bf80ad782a111a2f5b6ae13534e1..ae6f161ec942280c00ad3431bf1b1746b863655f 100644 (file)
@@ -8596,9 +8596,7 @@ static void
 mention (struct breakpoint *b)
 {
   b->ops->print_mention (b);
-  if (current_uiout->is_mi_like_p ())
-    return;
-  printf_filtered ("\n");
+  current_uiout->text ("\n");
 }
 \f
 
@@ -9795,12 +9793,9 @@ print_mention_ranged_breakpoint (struct breakpoint *b)
   gdb_assert (bl);
   gdb_assert (b->type == bp_hardware_breakpoint);
 
-  if (uiout->is_mi_like_p ())
-    return;
-
-  printf_filtered (_("Hardware assisted ranged breakpoint %d from %s to %s."),
-                  b->number, paddress (bl->gdbarch, bl->address),
-                  paddress (bl->gdbarch, bl->address + bl->length - 1));
+  uiout->message (_("Hardware assisted ranged breakpoint %d from %s to %s."),
+                 b->number, paddress (bl->gdbarch, bl->address),
+                 paddress (bl->gdbarch, bl->address + bl->length - 1));
 }
 
 /* Implement the "print_recreate" breakpoint_ops method for
This page took 0.031488 seconds and 4 git commands to generate.