This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
breakpoints/1808: Use function.line+offset to locate breakpoints
- From: cagney at redhat dot com
- To: gdb-gnats at sources dot redhat dot com
- Date: 9 Nov 2004 15:59:40 -0000
- Subject: breakpoints/1808: Use function.line+offset to locate breakpoints
- Reply-to: cagney at redhat dot com
>Number: 1808
>Category: breakpoints
>Synopsis: Use function.line+offset to locate breakpoints
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Tue Nov 09 16:08:02 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: cagney@redhat.com
>Release: 2004-11-09
>Organization:
>Environment:
all
>Description:
[suggested by RMS]
Say the user enters:
(gdb) break file.c:100
GDB stores this as {file="file.c",line==100} and then maps that onto a breakpoint address.
When the program is restarted, GDB re-uses the same technique. Again setting the breakpoint at {file="file.c",line==100} converted into an address. Unfortunatly, if the source file changes, that location is no longer correct.
RMS suggests that we, instead or in addition, store the line number of the function containing {file,line}.
By doing that we can re-insert the breakpoint at:
new-bp-line = new-function-line
+ (old-bp-line - old-function-line)
i.e., a known offset into the function.
Doing this will make GDB robust to at least the most basic of source code changes.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: