Comment 26 for bug 111869

Revision history for this message
In , Matz (matz) wrote :

Created an attachment (id=217718)
make gdb print %ebp based backtraces

The snippet from the conversation mostly doesn't apply in our cases.
First, due to stripping there is no .debug_frame section anymore, and
without exceptions of course also no .eh_frame (on i386 at least).

Which also means that we can't find the borders of the function a frame
is associated with, and hence can't do any prologue analysis on these
intermediate frames.

(The speculation about -fomit-frame-pointer doesn't apply either, because
we don't compile with that option on i386, otherwise also valgrind would be
lost)

What needs to happen is simply that the fallback unwinder (that gdb
correctly uses if no dwarf debug info exists for the frame at hand)
has to cope with this situation that it doesn't find function borders.
It partly already assumes that it then is a normal %ebp frame, and
if it already assumes so partly, we can also make use of it.

The patch in this attachment does that. It's only for frames where no
debuginfo exists, so it's a strict improvement to the current situation. The
only cases where it could break (but not worse than before) if such frame
happens to be without a frame pointer, i.e. compiled with
-fomit-frame-pointer. We are lost then, for such frames we have no choice
than to use debug info.