Mail Archives: djgpp/1998/10/22/05:08:22
On Wed, 21 Oct 1998, Doug Gale wrote:
> I'd much rather disable optimization when chasing a bug and using
> the debugger, than leave it enabled so it can see uninitialized
> variables and other warnings.
A much better way (IMHO) is to use expressions instead of the
(missing) variables, and debug the same optimization level as in the
production version.
The variable that was optimized into a register is usually produced by
some expression computed earlier. Displaying the value of that
expression instead of the variable solves the problem without
requiring you to disable optimizations, which means you are debugging
a different program.
Introducing a global variable that is assigned the value of the
variable you are chasing is another way of solving that problem
without disabling optimizations.
- Raw text -