This is the mail archive of the
mailing list for the GDB project.
Re: MACROS in gdb ???
- To: Aditya Chugh <Aditya at in dot huawei dot com>
- Subject: Re: MACROS in gdb ???
- From: Kevin Buettner <kevinb at cygnus dot com>
- Date: Tue, 20 Mar 2001 09:50:53 -0700
- Cc: gdb at sourceware dot cygnus dot com
- References: <Pine.SUN.3.91.1010320112059.7756N-100000@is>
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.)