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: preprocessor macro support (should actually work now)


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.


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