Add first preprocessor macro-expansion files.
* macroexp.c, macroexp.h, macrotab.c, macrotab.h: New files.
* Makefile.in (SFILES): Add macrotab.c, macroexp.c.
(splay_tree_h, macroexp_h, macrotab_h): New variable.
(HFILES_NO_SRCDIR): Add macrotab.h, macroexp.h.
(COMMON_OBS): Add macrotab.o, macroexp.o.
(macroexp.o, macrotab.o): New rules.
Revert 8 May change; it's going to be revised.
Add first preprocessor macro-expansion files.
* macroexp.c, macroexp.h, macrotab.c, macrotab.h: New files.
* Makefile.in (SFILES): Add macrotab.c, macroexp.c.
(splay_tree_h, macroexp_h, macrotab_h): New variable.
(HFILES_NO_SRCDIR): Add macrotab.h, macroexp.h.
(COMMON_OBS): Add macrotab.o, macroexp.o.
(macroexp.o, macrotab.o): New rules.
Add macro structures to GDB's symbol tables.  Nobody puts anything
in them yet.
* symtab.h (struct symtab): New member: `macro_table'.
* buildsym.h (pending_macros): New global variable.
* buildsym.c: #include "macrotab.h".
(buildsym_init): Initialize `pending_macros'.
(end_symtab): If we found macro information while reading a CU's
debugging info, do build a symtab structure for it.  Make the
symtab point to the macro information, and clear the
`pending_macros' pointer which held it while we were reading the
debug info.
(really_free_pendings): Free any pending macro table.
* objfiles.h (struct objfile): New member: `macro_cache'.
* objfiles.c (allocate_objfile): Set allocate and free functions
for the macro cache's objstack.
(free_objfile): Empty the macro cache's obstack.
* symfile.c (reread_symbols): Empty the macro cache's obstack, and
set new allocate and free functions for it.
* solib-sunos.c (allocate_rt_common_objfile): Set allocate and
free functions for the macro cache's objstack.  (Why is this
function building its own objfile?)
* symmisc.c (print_objfile_statistics): Print statistics on the
macro bcache.
* Makefile.in: Note that buildsym.o depends on macrotab.h.
* Makefile.in (buildsym.o): Fix variable reference.
Teach the Dwarf 2 reader to read macro information.
* dwarf2read.c: #include "macrotab.h".
(dwarf_macinfo_buffer): New variable.
(struct dwarf2_pinfo): New members: dwarf_macinfo_buffer, and
dwarf_macinfo_size.
(DWARF_MACINFO_BUFFER, DWARF_MACINFO_SIZE): New macros.
(dwarf2_missing_macinfo_section, dwarf2_macros_too_long,
dwarf2_macros_not_terminated, dwarf2_macro_outside_file,
dwarf2_macro_unmatched_end_file, dwarf2_macro_malformed_definition,
dwarf2_macro_spaces_in_definition): New complaints.
(dwarf2_has_info): Initialize dwarf_macinfo_offset.
(dwarf2_build_psymtabs): Read the .dwarf_macinfo section.
(dwarf2_build_psymtabs_hard): Record the buffer and its size in
the partial symbol table.
(psymtab_to_symtab_1): Set the macinfo buffer and size globals
from what's recorded in the partial symbol table.
(read_file_scope): If the compilation unit has a
`DW_AT_macro_info' attribute, read its macro information.
* Makefile.in (dwarf2read.o): Depend on macrotab.h.
Properly track the size of the current objfile's .debug_line section.
* dwarf2read.c (struct dwarf2_pinfo): New member: dwarf_line_size.
(DWARF_LINE_SIZE): New macro.
(dwarf2_build_psymtabs_hard): Record the line section's size in
the partial symbol table.
(psymtab_to_symtab_1): Restore dwarf_line_size from the partial
symbol table.
Add commands for manually expanding macros and showing their
definitions.
* macrocmd.c, macroscope.c, macroscope.h: New files.
* Makefile.in (SFILES): Add macrocmd.c, macroscope.c.
(macroscope_h): New variable.
(HFILES_NO_SRCDIR): Add macroscope.h.
(COMMON_OBS): Add macrocmd.o, macroscope.o.
(macroscope.o, macrocmd.o): New rules.
Revert last reversion.  The original was better.
* gdb.base/printcmds.exp (test_integer_literals_rejected):
Recognize more detailed error message produced by the macro
expander's lexical analyzer.
* lib/gdb.exp (test_print_reject): Same.
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.