Gcc options for improving debugging?

Frank Ch. Eigler fche@redhat.com
Thu Jul 20 16:11:00 GMT 2006


Alex Bennee <kernel-hacker@bennee.com> writes:

> By default we build our software with -O3 which brings in a host of
> optimisations which make following code in GDB a pain. [...]
> An alternate approach is to compile with -O3 but turn off specific
> optimisations which make life tricky for gdb. [...]

There is an increasing appreciation in gcc land for the need to debug
fully optimized programs, which is manifesting itself with gradual
improvements in the quality of debugging information gcc emits.  For
those cases where the data is outright missing or incorrect, you will
get more sympathy for such bug reports than perhaps in the past.

None of that may actually unravel inherent phenomena such as "funky
execution order" or "compressed backtraces", but they should improve
accurate visibility of those source-level constructs that survive into
the binary stage.

- FChE



More information about the Gdb mailing list