Mail Archives: djgpp/1995/01/13/22:56:37
Previously:
DR> I also like the idea of gcc -g implying gcc -g -O0.
I don't understand exactly what the advantages of this could possibly be.
Will the program be easier to debug if it's slower? Theoretically, that should
be the only difference optimization makes...
------------------------------------------------------------------------------
The problem of trying to debug optimized code are that the compiler, during
optimization can do lots of things to move things around and reorganize
your code so that things aren't where you had them originally, i.e the
assembly code may not match your source anymore. Generally, I think
people don't try to debug optimized code, unless the problem only appears
when optimizations are turned on. By debug I mean use a source level
debugger such as gdb. Using the old standby method of "printfs" wouldn't
make much difference as far as having optimizations on or off, of course.
- Raw text -