This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Remove some is_mi_like_p from breakpoint code


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2d33446d4d58edcf993f42957cfe9627c88f112f

commit 2d33446d4d58edcf993f42957cfe9627c88f112f
Author: Tom Tromey <tom@tromey.com>
Date:   Sun Apr 29 20:52:26 2018 -0600

    Remove some is_mi_like_p from breakpoint code
    
    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.

Diff:
---
 gdb/ChangeLog           |  7 +++++++
 gdb/break-catch-throw.c |  4 +---
 gdb/breakpoint.c        | 13 ++++---------
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 97260fb..f1da8fb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
 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.
 
 2018-04-30  Tom Tromey  <tom@tromey.com>
diff --git a/gdb/break-catch-throw.c b/gdb/break-catch-throw.c
index a911ddd..bdb552c 100644
--- a/gdb/break-catch-throw.c
+++ b/gdb/break-catch-throw.c
@@ -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;
 }
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index b019610..ae6f161 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -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");
 }
 
 
@@ -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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]