List Info

Thread: Gcc options for improving debugging?




Gcc options for improving debugging?
user name
2006-07-19 13:31:38
>>>>> "Alex" == Alex Bennee
<kernel-hackerbennee.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

Gcc options for improving debugging?
user name
2006-07-19 13:31:38
>>>>> "Alex" == Alex Bennee
<kernel-hackerbennee.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

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )