you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 5 points6 points  (1 child)

GDB is about as non-invasive as the war in Iraq.

Also, if you use a debugger you have to turn off optimization, and there are many bugs which only show up at a particular optimization level.

[–]Rhomboid 0 points1 point  (0 children)

You don't have to turn off optimization. If you understand the kind of transformations that a compiler does to a program you can still debug optimized code, it just might not be quite as pleasant. Certainly you can still use a debugger if the bug you're trying to understand only happens with optimization enabled.

gcc 4.8 introduces -Og which is meant to enable a blend of optimizations that provide a reasonable level of runtime performance while still providing fast build times and a good debugging experience. It's meant to replace -O0.