www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/22/05:08:22

Date: Thu, 22 Oct 1998 10:12:34 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Doug Gale <dgale AT mailexcite DOT com>
cc: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>, djgpp AT delorie DOT com
Subject: Re: Profile suggestions
In-Reply-To: <JOAKAOMKMAMEAAAA@mailexcite.com>
Message-ID: <Pine.SUN.3.91.981022101214.2003V-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019