This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: C/C++ preprocessor macro support for GDB


Neil Booth wrote:
> 
> [...]  We should have GCC and GDB agree
> perfectly on macro expansion, otherwise there is little point.

As someone who has had much of his time consumed by keeping
another preprocessor (Apple's cpp-precomp) in sync with GNU cpp,
I think we really should try hard to avoid duplicate macro
expanders.

The hallmark of a good expression evaluator in the debugger is
that it passes the "cut-n-paste" test, that is, you can take any
chunk of program source code and have the debugger produce the
same result as the compiler.  This is an ideal, and very hard to
accomplish everywhere, but if the debugger uses the compiler's
own preprocessing library, it gets a long way there with just
the one step.

I also imagine the extreme puzzlement of a GDB user who spends
an hour trying to figure why stepping always goes down the else
clause, when the evaluation of the if condition clearly shows the
result is true - because the if condition includes a macro that
was expanded differently...

Stan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]