This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Gcc options for improving debugging?


>>>>> "Alex" == Alex Bennee <kernel-hacker@bennee.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
 Alex> pain.

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> have:

 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.

      paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]