Date: Thu, 22 Oct 1998 10:12:34 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Doug Gale cc: Hans-Bernhard Broeker , djgpp AT delorie DOT com Subject: Re: Profile suggestions In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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.