This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Macro and Define
- To: Daniel Berlin <dan at cgsoftware dot com>
- Subject: Re: Macro and Define
- From: Stan Shebs <shebs at apple dot com>
- Date: Mon, 14 Aug 2000 19:32:57 -0700
- CC: Fabrice Gautier <Fabrice_Gautier at sdesigns dot com>, "GDB (E-mail)" <gdb at sourceware dot cygnus dot com>
- References: <Pine.LNX.4.21.0008141852290.7742-100000@propylaea.anduin.com>
Daniel Berlin wrote:
>
> On Mon, 14 Aug 2000, Stan Shebs wrote:
>
> > Dwarf2 has a specification for how to record macros, but alas, GCC
> > does not include those in its output, nor does GDB have the machinery
> > to run a preprocessor over an expression before evaluating it.
>
> 1. GCC plans to include this info soon, the hooks exist, they just do
> nothing right now.
Cool! I remember that as a wishlist item, but hadn't heard that
anybody was actually working on it.
> 2. GDB wouldn't need to run a preprocessor over an expression before
> evaluating it.
> You could simply determine that the name given is a macro symbol, and do
> the right thing, since the macro info given in dwarf2 contains all the
> info you need.
Yeah, that's what I meant by "preprocessor". I think you probably still
have to have a separate phase prior to expression tree construction,
because some macros construct new names. Also, the set of macro defns
changes depending on where you are in the source code, so something
like a "display MACRO(glob)" can get real interesting as you're
stepping along!
Stan