This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFC: preserve line number when skipping prologue
- From: Tom Tromey <tromey at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 26 Mar 2009 17:17:53 -0600
- Subject: Re: RFC: preserve line number when skipping prologue
- References: <m3tz5gvwe3.fsf@fleche.redhat.com> <20090326224949.GM9472@adacore.com>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Tom> (gdb) b 3
Tom> Breakpoint 1 at 0x80483c5: file m.c, line 7.
Tom> (gdb) b 9
Tom> Breakpoint 2 at 0x80483d1: file m.c, line 9.
Joel> I agree that we need to be consistent between the two cases!
Joel> I don't know which one I prefer, though. Actually, I think I would
Joel> prefer if GDB reported the real line on which it was inserted. But
Joel> that would be a change of behavior from before, and that could
Joel> have ramifications that could potentially annoys the users
Joel> (on the "clear" command, for instance).
Yeah, I think there are reasons to want both.
On the one hand, the line number you asked for is used if the
breakpoint ever needs to be reset. So, it is relevant.
On the other hand, seeing where the breakpoint actually ends up is
also useful, because that tells you what is actually happening at the
moment.
Perhaps we could emit:
(gdb) b 3
Breakpoint 1 at 0x80483c5: file m.c, line 3.
(Line 3 is not executable; actually set at line 7.)
This is probably not relevant for GUIs.
Joel> So I think that your patch is the most reasonable approach
Ok, I'm going to check it in. Thanks for looking at this.
Tom