What are efficient ways to debug an optimized C/C++ program?

Viewed 6095

Many times I work with optimized code (sometimes even involving vectorized loops), which contain bugs and such. How would one debug such code? I'm looking for any kind of tools or techniques. I use the following (possibly outdated) tools, so I'm looking to upgrade.

I use the following:

  • Since with ddd, you cannot see the code, I use gdb+ dissambler command and see the produced code; I can't really step through the program using this.
  • ndisasm

Thanks

4 Answers
Related