From: Mircea Gherzan <mircea.gherzan@intel.com>
To: tromey@redhat.com, vladimir@codesourcery.com, marc.khouzam@ericsson.com
Cc: gdb-patches@sourceware.org, mgherzan@gmail.com,
Mircea Gherzan <mircea.gherzan@intel.com>
Subject: [PATCH 1/3] MI: fix the result of -break-insert with multiple locations
Date: Thu, 28 Feb 2013 18:30:00 -0000 [thread overview]
Message-ID: <1362076197-15363-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>
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
next reply other threads:[~2013-02-28 18:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-28 18:30 Mircea Gherzan [this message]
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
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=1362076197-15363-1-git-send-email-mircea.gherzan@intel.com \
--to=mircea.gherzan@intel.com \
--cc=gdb-patches@sourceware.org \
--cc=marc.khouzam@ericsson.com \
--cc=mgherzan@gmail.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