On Fri, May 16, 2008 at 11:28:20AM -0400, Aleksandar Ristovski wrote:
What happens is, we have restored the stack pointer but gdb is unaware of that fact and tries to unwind using already unwound value...
how is this supposed to work?
Poorly.
The biggest problem, in my opinion, is that GCC emits bogus unwind
info that does not describe epilogues. I don't know about other
compilers. So far no one has fixed this in a way that didn't bloat
debug info to an unacceptable size.
When DWARF unwinding is not in use, there's the in_epilogue_p hook.
Prologue analyzers could also detect epilogues using the same
technique. But this is slow and complicated.