This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA/RFC] Report the original location specification for a breakpoint.

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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]