This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFC: preprocessor macro support (should actually work now)
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- To: Jim Blandy <jimb at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 29 Mar 2002 10:01:02 +0000
- Subject: Re: RFC: preprocessor macro support (should actually work now)
- References: <20020328070504.24F455EA11@zwingli.cygnus.com>
Jim Blandy wrote:-
>
> This is a revised version of the preprocessor macro support patch I
> posted before, tested against the current GCC sources. I've fixed a
> bunch of bugs, and made it tolerant of the GCC bugs that came up.
>
> So please try it out; compile with the -gdwarf-2 -g3 flags.
Hi Jim,
I've done a bit more research into examples of when token marking is
needed when expanding macros. There are a few in the CPP testsuite;
here is one (I got this by disabling the feature in CPP and seeing
what broke):
#define M(x) 2 + M(x)
#define N(a) M(a)
N (N (9))
The correct expansion is
2 + M(2 + M(9))
I expect your code (though I've not tested it!) will get:
2 + M(2 + 2 + M(9))
Would you try this? Thanks,
Neil.