From: Mircea Gherzan <mircea.gherzan@intel.com>
To: tromey@redhat.com, vladimir@codesourcery.com, marc.khouzam@ericsson.com
Cc: gdb-patches@sourceware.org, mircea.gherzan@intel.com
Subject: [RFC] Fix the MI result of -break-insert with multiple locations
Date: Tue, 29 Jan 2013 14:36:00 -0000 [thread overview]
Message-ID: <1359470164-32004-1-git-send-email-mircea.gherzan@intel.com> (raw)
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
next reply other threads:[~2013-01-29 14:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-29 14:36 Mircea Gherzan [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1359470164-32004-1-git-send-email-mircea.gherzan@intel.com \
--to=mircea.gherzan@intel.com \
--cc=gdb-patches@sourceware.org \
--cc=marc.khouzam@ericsson.com \
--cc=tromey@redhat.com \
--cc=vladimir@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox