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: Joel Brobecker <brobecker at adacore dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 26 Mar 2009 15:49:49 -0700
- Subject: Re: RFC: preserve line number when skipping prologue
- References: <m3tz5gvwe3.fsf@fleche.redhat.com>
> 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