Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <vladimir@codesourcery.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA/RFC] Report the original location specification for a breakpoint.
Date: Tue, 15 Apr 2008 11:52:00 -0000	[thread overview]
Message-ID: <200804151434.57665.vladimir@codesourcery.com> (raw)


Presently, GDB/MI fails to report the *original* location specified
for a breakpoint. As result, it's not possible to tell a breakpoint
create by:

	break foo

from a breakpoint create by 

	break foo.cpp:10

This is not very nice for frontends, because if users adds a breakpoint
in GDB console, it is desirable to show the breakpoint in the breakpoints
window exactly as user have set it.  Furthermore, is the list of breakpoints
is persisted by the frontend, it is crucial to persist it using the original
location. If the program source is modified, the difference betweeen foo and
foo.cpp:10 becomes significant.

This patch adds the necessary MI support for reporting the original location.
It's not ready to be checked in because MI testsuite will likely break all over.
OTOH, I've tested this with KDevelop4, and it works just fine. I'll fix this
before committing.

Is this patch OK?

In fact, I wonder if I can commit patches like this, that touch files
outside of MI code but apparently change behaviour only for MI, without
approval. Any comments?

- Volodya

---
 gdb/breakpoint.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 6830efe..01e0a9b 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -3683,6 +3683,10 @@ print_one_breakpoint_location (struct breakpoint *b,
       print_command_lines (uiout, l, 4);
       do_cleanups (script_chain);
     }
+
+  if (!part_of_multiple && b->addr_string)
+    ui_out_field_string (uiout, "original-location", b->addr_string);
+
   do_cleanups (bkpt_chain);
   do_cleanups (old_chain);
 }
-- 
1.5.3.5


             reply	other threads:[~2008-04-15 10:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-15 11:52 Vladimir Prus [this message]
2008-04-17  9:16 ` Daniel Jacobowitz
2008-04-17 11:52   ` Vladimir Prus
2008-04-17 12:35     ` Nick Roberts
2008-04-17 15:28       ` Vladimir Prus
2008-04-17 21:17         ` Nick Roberts
2008-04-17 17:51     ` Daniel Jacobowitz
2008-04-17 21:25       ` Joel Brobecker
2008-04-17 21:31         ` Daniel Jacobowitz
2008-04-17 23:08           ` [commit] print breakpoint address only once (branch?) Joel Brobecker
2008-04-17 23:21             ` Daniel Jacobowitz
2008-04-19  2:08               ` Joel Brobecker
2008-04-24 11:45     ` [RFA/RFC] Report the original location specification for a breakpoint Vladimir Prus

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=200804151434.57665.vladimir@codesourcery.com \
    --to=vladimir@codesourcery.com \
    --cc=gdb-patches@sources.redhat.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