This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

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?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]