Re: MACROS in gdb ???

Kevin Buettner
2001-03-21T15:59:00Z

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