This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFC] Fix the MI result of -break-insert with multiple locations
- From: Mircea Gherzan <mircea dot gherzan at intel dot com>
- To: tromey at redhat dot com, vladimir at codesourcery dot com, marc dot khouzam at ericsson dot com
- Cc: gdb-patches at sourceware dot org, mircea dot gherzan at intel dot com
- Date: Tue, 29 Jan 2013 15:36:04 +0100
- Subject: [RFC] Fix the MI result of -break-insert with multiple locations
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