This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Gcc options for improving debugging?
- From: Daniel Jacobowitz <drow at false dot org>
- To: Alex Bennee <kernel-hacker at bennee dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 19 Jul 2006 09:05:48 -0400
- Subject: Re: Gcc options for improving debugging?
- References: <1153308778.9831.49.camel@okra.transitives.com>
On Wed, Jul 19, 2006 at 12:32:58PM +0100, Alex Bennee wrote:
> An alternate approach is to compile with -O3 but turn off specific
> optimisations which make life tricky for gdb. So far I have:
>
> * -ggdb3 (obviously)
This doesn't really give you anything beyond -g. The only difference
is that it will allow you to expand macros, and make your object files
huge.
> * -fno-omit-frame-pointer (seems to help with finding some variables)
>
> What else would you suggest? Would this be worth adding to section 4.1
> of the manual "Compiling for debugging".
Beyond this there's not really much you can do. If you need inlining,
you're in trouble, because GDB does not (yet) have decent inlining
support - but it's on the list of things to improve.
--
Daniel Jacobowitz
CodeSourcery