From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Buettner To: Aditya Chugh Cc: gdb@sourceware.cygnus.com Subject: Re: MACROS in gdb ??? Date: Wed, 21 Mar 2001 15:59:00 -0000 Message-id: <1010320165053.ZM10189@ocotillo.lan> References: X-SW-Source: 2001-03/msg00199.html On Mar 20, 11:23am, Eli Zaretskii wrote: > (This is why I think your ``solution'' of disabling optimizations is > Bad Idea: you are debugging a program which is very different from the > production code that will actually run on your target system.) A compromise solution is to only recompile those files that you think you'll be actively debugging with a lower optimization level. You are still debugging a program which'll be different than the production code, but only parts of it are different. Also, it should be noted that it's frequently easier to just turn off optimizations at times when the debugger is *really* needed and then turn them back on again once the problem is solved. (I usually make an attempt at figuring out the problem in the optimized version; but sometimes either there just isn't enough debug information or the behavior is too confusing. At that point, I'll recompile the source file in question with lower optimization.) Kevin