Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] Fix the MI result of -break-insert with multiple locations
@ 2013-01-29 14:36 Mircea Gherzan
  2013-01-29 15:39 ` Marc Khouzam
  2013-01-29 19:45 ` André Pönitz
  0 siblings, 2 replies; 12+ messages in thread
From: Mircea Gherzan @ 2013-01-29 14:36 UTC (permalink / raw)
  To: tromey, vladimir, marc.khouzam; +Cc: gdb-patches, mircea.gherzan

The current MI output when printing a breakpoint with multiple locations
is not conformant to the MI specification:

  bkpt={number="1", ...},{number="1.1", ...},{number="1.2", ...}

This patch fixes this issue by moving the locations to a list inside the
first tuple:

  bkpt={number="1", ... , locations=[{number="1.1", ...}, ...]}

2013-01-28  Mircea Gherzan  <mircea.gherzan@intel.com>

	* breakpoint.c (print_one_breakpoint): Use a list of breakpoint
	locations that adheres to the MI specification.

Signed-off-by: Mircea Gherzan <mircea.gherzan@intel.com>
---
 gdb/breakpoint.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 216ac73..7050f96 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -6216,7 +6216,6 @@ print_one_breakpoint (struct breakpoint *b,
   bkpt_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "bkpt");
 
   print_one_breakpoint_location (b, NULL, 0, last_loc, allflag);
-  do_cleanups (bkpt_chain);
 
   /* If this breakpoint has custom print function,
      it's already printed.  Otherwise, print individual
@@ -6235,8 +6234,11 @@ print_one_breakpoint (struct breakpoint *b,
 	  && (b->loc->next || !b->loc->enabled))
 	{
 	  struct bp_location *loc;
+	  struct cleanup *loc_list;
 	  int n = 1;
 
+	  loc_list = make_cleanup_ui_out_list_begin_end (uiout, "locations");
+
 	  for (loc = b->loc; loc; loc = loc->next, ++n)
 	    {
 	      struct cleanup *inner2 =
@@ -6244,8 +6246,12 @@ print_one_breakpoint (struct breakpoint *b,
 	      print_one_breakpoint_location (b, loc, n, last_loc, allflag);
 	      do_cleanups (inner2);
 	    }
+
+	  do_cleanups (loc_list);
 	}
     }
+
+  do_cleanups (bkpt_chain);
 }
 
 static int
-- 
1.7.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-01-30 16:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-29 14:36 [RFC] Fix the MI result of -break-insert with multiple locations Mircea Gherzan
2013-01-29 15:39 ` Marc Khouzam
2013-01-29 15:52   ` Mircea Gherzan
2013-01-29 16:04     ` Marc Khouzam
2013-01-29 16:26       ` Vladimir Prus
2013-01-29 19:28         ` Mircea Gherzan
2013-01-29 20:36           ` Vladimir Prus
2013-01-29 20:55             ` Mircea Gherzan
2013-01-29 19:45 ` André Pönitz
2013-01-29 20:42   ` Marc Khouzam
2013-01-29 22:14     ` André Pönitz
2013-01-30 16:27       ` Marc Khouzam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox