GCC, GDB v6 and -fomit-frame-pointer

Daniel Jacobowitz drow@mvista.com
Thu Oct 9 12:55:00 GMT 2003


On Thu, Oct 09, 2003 at 12:36:08PM +0200, Jakub Jelinek wrote:
> On Thu, Oct 09, 2003 at 08:33:00AM -0400, Daniel Jacobowitz wrote:
> > On Thu, Oct 09, 2003 at 10:43:22AM +0100, Alex Hornby wrote:
> > > 
> > > Does the new DWARF2 call frame in gdb 6.0 support mean programs compiled 
> > > with GCC and -fomit-frame-pointer can now be debugged? That would be 
> > > great as -fomit-frame-pointer provides quite a performance boost on x86.
> > > 
> > > Assuming this is possible, what GCC and binutils versions would be 
> > > needed to take advantage of this?
> > 
> > In general yes.  Backtraces should work.  Ultra-accurate argument and
> > local variable printing requires -fvar-tracking in GCC so it's a little
> > flaky now, but unwinding should be fine.
> > 
> > Anything recent.  I think 3.2, 3.3 are fine.
> 
> Even without CFI info? With the exception of IA-64/AMD64, GCC doesn't
> generate unwind info by default, only when -fasynchronous-unwind-tables.

Sorry, unstated assumption.  This only works if you build with
debugging information.  GDB parses both .eh_frame and .debug_frame, and
all the necessary CFI should be in .debug_frame with -gdwarf-2.

If debugging info bothers you, use objcopy --add-gnu-debuglink :)

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



More information about the Gcc mailing list