Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA/RFC] Report the original location specification for a breakpoint.
@ 2008-04-15 11:52 Vladimir Prus
  2008-04-17  9:16 ` Daniel Jacobowitz
  0 siblings, 1 reply; 13+ messages in thread
From: Vladimir Prus @ 2008-04-15 11:52 UTC (permalink / raw)
  To: gdb-patches


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-04-24  8:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-15 11:52 [RFA/RFC] Report the original location specification for a breakpoint Vladimir Prus
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

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