This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: stabs at function entry point?
- From: Dale Johannesen <dalej at apple dot com>
- To: Geoff Keating <geoffk at geoffk dot org>
- Cc: Dale Johannesen <dalej at apple dot com>, gcc at gcc dot gnu dot org, Jim Ingham <jingham at apple dot com>
- Date: Wed, 13 Mar 2002 14:07:29 -0800
- Subject: Re: stabs at function entry point?
On Wednesday, March 13, 2002, at 12:52 AM, Geoff Keating wrote:
> Line number comments are also used for the reverse mapping: Given a
> location, what source line corresponds to it?
>
> So, suppose the user stops at the first instruction of a function.
> What line should the debugger display? Hopefully, some line in the
> function. Thus, there should be at least one line-number stab at the
> very start of the function.
Doesn't follow. There is also a function stab, which contains the
line number of the beginning of the function definition. gdb does
use that. The behavior with my patch (but with the scheduler off)
is as follows:
When you breakpoint on a function: gdb stops after the prologue,
and displays the first line within the function that has executable
code.
When you breakpoint on *&function: gdb stops at the first insn,
and displays the line of the function definition.
That looks OK to me; what do you think?
> If the prologue is intermixed with the code for statements the
> function, I'd like to think that we'd also get correct line numbers
> for the statements, even though the prologue hasn't finished executing
> yet. Otherwise it's possible to have no way to set a breakpoint on
> some lines even though there are instructions corresponding to those
> lines. In fact, if the epilogue is treated similarly, and the
> prologue and epilogue overlap (theoretically possible), there might be
> no line number notes at all.
I have no strong feelings about what should happen when scheduling is
on; debug info is unreliable in that case anyway. What do you think, jim?