This is the mail archive of the
mailing list for the GDB project.
Re: Gcc options for improving debugging?
- From: Paul Koning <pkoning at equallogic dot com>
- To: kernel-hacker at bennee dot com
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 19 Jul 2006 09:31:38 -0400
- Subject: Re: Gcc options for improving debugging?
- References: <firstname.lastname@example.org>
>>>>> "Alex" == Alex Bennee <email@example.com> writes:
Alex> Hi, By default we build our software with -O3 which brings in a
Alex> host of optimisations which make following code in GDB a
Sure enough, exactly as documented.
Alex> An alternate approach is to compile with -O3 but turn off
Alex> specific optimisations which make life tricky for gdb. So far I
Alex> * -ggdb3 (obviously) * -fno-omit-frame-pointer (seems to help
Alex> with finding some variables)
-ggdb3??? That's not an optimization option.
I find that the simplest and best answer is to do most debugging using
a version compiled with -O1. That gives you inline assembler,
inlining of things that are specifically called out to be inlined,
etc. But it doesn't do much instruction reordering.