Re: [RFC] breakpoints and function prologues...

Andrew Cagney
2002-08-16T01:05:19Z

>
> Most users I have talked to think that setting a break on the "{" at the beginning of a function means the same thing as setting a breakpoint on the function. But that is not the case. "break funcName" is AFTER the prologue, "break file:<line containing "{"> is the true function beginning.

Don't forget that ``break func'' is is going to change. It's going to
go back to the start of the function!

> However, suppose the user puts his breakpoint on the "{" beginning a function (this is what most folks do when they want to break on a function generically, BTW.) Then when the IDE stops, it creates the varobjs for the local variables, which naively get their frame context from the frame pointer (which because we stopped at the beginning of the prologue hasn't been updated yet). Then the user steps, and all of the variables fail to evaluate correctly, since their frame pointer actually points to the previous frame, and there is no such variable in the previous frame...

That is a bug in gdb. GDB should be using the debug info that lets it
set a breakpoint anywhere in the function.

enjoy,
Andrew