backtrace() on ix86?

Jakub Jelinek jakub@redhat.com
Mon Jul 19 11:55:00 GMT 2004


On Mon, Jul 19, 2004 at 01:40:17PM +0200, Thorsten Kukuk wrote:
> 
> Hi,
> 
> It seems, that the backtrace() function on ix86 always misses the
> last function. A sample test case is included. bar() is never printed
> on ix86:

backtrace() on x86 ATM uses the chain of saved %ebp values
instead of dwarf2 unwind info (-fasynchronous-unwind-tables is not the
default on x86, unlike e.g. x86-64).
As such it has no knowledge about signal frames etc.
See http://sources.redhat.com/ml/libc-hacker/2003-12/msg00054.html
for i386 implementation of backtrace(3) using both .eh_frame
(as long as it is available) and with fallback to %ebp chains.
Your testcase would need to be compiled with -fasynchronous-unwind-tables
to work though.

	Jakub



More information about the Libc-alpha mailing list