This is the mail archive of the
gdb-cvs@sources.redhat.com
mailing list for the GDB project.
src/gdb ChangeLog Makefile.in c-exp.y c-lang.c ...
- From: jimb at sources dot redhat dot com
- To: gdb-cvs at sources dot redhat dot com
- Date: 10 May 2002 16:43:35 -0000
- Subject: src/gdb ChangeLog Makefile.in c-exp.y c-lang.c ...
CVSROOT: /cvs/src
Module name: src
Branch: jimb-macro-020506-branch
Changes by: jimb@sources.redhat.com 2002-05-10 09:43:35
Modified files:
gdb : ChangeLog Makefile.in c-exp.y c-lang.c c-lang.h
parse.c parser-defs.h
Log message:
Expand preprocessor macros in C expressions.
* c-lang.h: #include "macroexp.h", for macro_lookup_ftype.
(scan_macro_expansion, scanning_macro_expansion,
finished_macro_expansion): New function declarations.
(expression_macro_lookup_func, expression_macro_lookup_baton): New
variable declarations.
* parser-defs.h (expression_context_pc): New declaration.
* parse.c (expression_context_pc): New variable.
(parse_exp_1): Set expression_context_pc, as well as
expression_context_block.
* c-exp.y (yylex): If we're not already reading the result of a
macro expansion, try to macro-expand the next token. When we're
done scanning a macro expansion, switch back to the mainline text.
Commas and `if's in a macro's expansion don't terminate the input.
* c-lang.c: #include "macroscope.h" and "gdb_assert.h".
(macro_original_text, macro_expanded_text,
expression_macro_lookup_func, expression_macro_lookup_baton): New
variables.
(scan_macro_expansion, scanning_macro_expansion,
finished_macro_expansion, scan_macro_cleanup, null_macro_lookup,
c_preprocess_and_parse): New functions.
(c_language_defn, cplus_language_defn, asm_language_defn): Call
c_preprocess_and_parse, instead of c_parse.
* Makefile.in (c_lang_h): Note that this #includes macroexp.h.
(c-lang.o): Note dependency on macroscope.h and gdb_assert.h.
Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=jimb-macro-020506-branch&r1=1.2573.2.7&r2=1.2573.2.8
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/Makefile.in.diff?cvsroot=src&only_with_tag=jimb-macro-020506-branch&r1=1.180.2.7&r2=1.180.2.8
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/c-exp.y.diff?cvsroot=src&only_with_tag=jimb-macro-020506-branch&r1=1.9&r2=1.9.2.1
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/c-lang.c.diff?cvsroot=src&only_with_tag=jimb-macro-020506-branch&r1=1.11&r2=1.11.2.1
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/c-lang.h.diff?cvsroot=src&only_with_tag=jimb-macro-020506-branch&r1=1.4&r2=1.4.4.1
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/parse.c.diff?cvsroot=src&only_with_tag=jimb-macro-020506-branch&r1=1.23&r2=1.23.2.1
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/parser-defs.h.diff?cvsroot=src&only_with_tag=jimb-macro-020506-branch&r1=1.8&r2=1.8.2.1