backtrace/2024: backtrace fails when function ends with call to abort

Daniel Jacobowitz drow@false.org
Tue Nov 1 23:38:00 GMT 2005


The following reply was made to PR backtrace/2024; it has been noted by GNATS.

From: Daniel Jacobowitz <drow@false.org>
To: wilson@tuliptree.org
Cc: gdb-gnats@sources.redhat.com
Subject: Re: backtrace/2024: backtrace fails when function ends with call to abort
Date: Tue, 1 Nov 2005 18:32:52 -0500

 On Tue, Nov 01, 2005 at 11:01:59PM -0000, wilson@tuliptree.org wrote:
 > The backtrace is
 > #0  0xffffe410 in __kernel_vsyscall ()
 > #1  0x00afa118 in raise () from /lib/libc.so.6
 > #2  0x00afb888 in abort () from /lib/libc.so.6
 > #3  0x080483a5 in main (argc=Could not find the frame base for "main".) at test.c:4
 
 > Gdb uses the return address to generate the backtrace of the caller. 
 > On x86, the return address is one byte past the end of the call
 > instruction.  In this case, this is 1 byte past the end of the
 > function.  So gdb is trying to find the frame base for an address
 > outside the function, and is failing, because the location list
 > emitted by gcc only covers addresses inside the function.
 
 GDB already has a concept of "frame unwind address".  This is probably
 as simple as changing get_frame_pc to get_frame_address_in_block in
 dwarf2loc.c, right before that error message is produced.  Want to try
 that?
 
 -- 
 Daniel Jacobowitz
 CodeSourcery, LLC



More information about the Gdb-prs mailing list