From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1723 invoked by alias); 15 Apr 2008 10:35:22 -0000 Received: (qmail 1712 invoked by uid 22791); 15 Apr 2008 10:35:21 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 15 Apr 2008 10:35:03 +0000 Received: (qmail 16102 invoked from network); 15 Apr 2008 10:35:01 -0000 Received: from unknown (HELO wind.local) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 15 Apr 2008 10:35:01 -0000 From: Vladimir Prus Date: Tue, 15 Apr 2008 11:52:00 -0000 Subject: [RFA/RFC] Report the original location specification for a breakpoint. To: gdb-patches@sources.redhat.com X-TUID: e922bf5e109b668f X-Length: 875 X-UID: 160 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804151434.57665.vladimir@codesourcery.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-04/txt/msg00274.txt.bz2 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