Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] MI: fix the result of -break-insert with multiple locations
@ 2013-02-28 18:30 Mircea Gherzan
  2013-02-28 18:50 ` [PATCH 2/3] MI: add tests for breakpoints " Mircea Gherzan
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Mircea Gherzan @ 2013-02-28 18:30 UTC (permalink / raw)
  To: tromey, vladimir, marc.khouzam; +Cc: gdb-patches, mgherzan, 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>

gdb:
	* 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 fb57a57..67da346 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -6213,7 +6213,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
@@ -6232,8 +6231,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 =
@@ -6241,8 +6243,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] 10+ messages in thread

end of thread, other threads:[~2013-03-11 15:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-28 18:30 [PATCH 1/3] MI: fix the result of -break-insert with multiple locations Mircea Gherzan
2013-02-28 18:50 ` [PATCH 2/3] MI: add tests for breakpoints " Mircea Gherzan
2013-02-28 18:56 ` [PATCH 3/3] MI: document the format " Mircea Gherzan
2013-02-28 18:59   ` Eli Zaretskii
2013-03-02 16:53 ` [PATCH 1/3] MI: fix the result of -break-insert " André Pönitz
2013-03-07 16:32   ` Mircea Gherzan
2013-03-07 20:54     ` André Pönitz
2013-03-07 21:44       ` Marc Khouzam
2013-03-08  0:15         ` André Pönitz
2013-03-11 15:06           ` Mircea Gherzan

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