Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Gcc options for improving debugging?
@ 2006-07-19 13:05 Alex Bennee
  2006-07-19 13:31 ` Daniel Jacobowitz
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Alex Bennee @ 2006-07-19 13:05 UTC (permalink / raw)
  To: gdb

Hi,

By default we build our software with -O3 which brings in a host of
optimisations which make following code in GDB a pain. Artifacts I have
to deal with include:

* this=Variable "this" is not available and friends
* funky execution order when tracing
* Compressed backtraces due to inlineing

Now I have tackled this one way by introducing a -O0 variant of our
build for debugging. However it's becoming more tricky to compile with
low optimisation levels when we have some quite complex inline assembler
that needs a certain level of optimisation to be able to derive
constants from C++ functions.

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)
* -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".

--
Alex, homepage: http://www.bennee.com/~alex/
Hardware, n.: The parts of a computer system that can be kicked.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-07-20 15:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-19 13:05 Gcc options for improving debugging? Alex Bennee
2006-07-19 13:31 ` Daniel Jacobowitz
2006-07-19 17:50   ` Alex Bennee
2006-07-19 17:53     ` Paul Koning
2006-07-20 15:21       ` Daniel Jacobowitz
2006-07-19 17:33 ` Paul Koning
2006-07-20 16:11 ` Frank Ch. Eigler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox