Re: RFC: preserve line number when skipping prologue

Tom Tromey
2009-03-26T23:18:29Z

>>>>> "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