bug disappears if compiled with -O0

Eli Zaretskii eliz@gnu.org
Mon Jul 26 05:47:00 GMT 2004


> Date: Mon, 26 Jul 2004 00:38:33 +0200
> From: Baurjan Ismagulov <ibr@ata.cs.hun.edu.tr>
> 
> I'm trying to track down a problem in a dynamic library. However, the
> bug doesn't show up if the code is compiled with -O0 (it is normally
> compiled with -O2). Any pointers or tips on how to proceed (except
> printf)?

Just debug as usual, GDB can debug optimized code.

In fact, I suggest to do that always, since if you debug a program
compiled without optimizations, then ship a binary compiled with -O2,
you in effect debugged and tested a similar, but quite different code.



More information about the Gdb mailing list