This is the mail archive of the
mailing list for the GCC project.
Re: Designs for better debug info in GCC
> The piece of the puzzle we're still missing is how to get debuggers
> clever enough to decide where to set a breakpoint. Nowadays, debuggers
> (at least those I'm familiar with) tend to set breakpoints at the
> lowest-numbered PC corresponding to a given source line number. While
> this is useful at times, at other times what you want is the lowest PC
> after all instructions corresponding to the previous line, because at
> that point you know all the state of the previous line should be stable
> and hopefully still observable. Or something along these lines. I don't
> have a complete solution for this problem. It's very far from trivial,
> and I don't see that debug information can carry enough information for
> the compiler to aid the debugger in selecting where to place breakpoints
> in this regard.
Or you want the first instruction of that line that shows the actual flow
of control. Or sometimes other things, as you say.
A few of us were discussing this issue in person last week and we strongly
agree with your characterization that it's very far from trivial. The
consensus we came to is that the compiler should continue associating the
original line number with each instruction that came from it, but perhaps
should also provide additional, not-yet-defined annotations to allow the
debugger to be able to provide various different types of breakpoints,
corresponding to various purposes the programmer us using the breakpoints