Re: RFC: preserve line number when skipping prologue

Joel Brobecker
2009-03-26T22:50:07Z

> If I set a breakpoint on line 3, gdb reports line 7.
>
> (gdb) b 3
> Breakpoint 1 at 0x80483c5: file m.c, line 7.
>
> But if I set one on line 9, another non-executable line, gdb reports
> line 9:
>
> (gdb) b 9
> Breakpoint 2 at 0x80483d1: file m.c, line 9.

I agree that we need to be consistent between the two cases!

I don't know which one I prefer, though. Actually, I think I would
prefer if GDB reported the real line on which it was inserted. But
that would be a change of behavior from before, and that could
have ramifications that could potentially annoys the users
(on the "clear" command, for instance).

> 2009-03-26 Tom Tromey <tromey@redhat.com>
>
> * breakpoint.c (resolve_sal_pc): Preserve original line number
> when skipping prologue.

So I think that your patch is the most reasonable approach

--
Joel