summaryrefslogtreecommitdiff
path: root/gdb/macroscope.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2008-07-18 20:55:33 +0000
committerTom Tromey <tromey@redhat.com>2008-07-18 20:55:33 +0000
commit841edd2e8e5b0ace46bac925dfa97be9e8e63f1d (patch)
tree477ba6fc0e08f0d6b4438e983369c7600d815eb1 /gdb/macroscope.h
parent77e32f560ca48ecd355665642c4163bb1e415a8e (diff)
downloadgdb-841edd2e8e5b0ace46bac925dfa97be9e8e63f1d.tar.gz
gdb
PR gdb/855: * NEWS: Add entry for macro commands. * Makefile.in (macrocmd.o): Add gdb_string.h. * macroscope.h (user_macro_scope): Declare. (default_macro_scope): Update documentation. (macro_user_macros): Declare. * c-lang.c (c_preprocess_and_parse): Always attempt macro lookup. Use user_macro_scope. (null_macro_lookup): Remove. * macrotab.h (macro_callback_fn): Declare. (macro_for_each): Likewise. (macro_allow_redefinitions): Likewise. * macrotab.c (foreach_macro): New function (macro_for_each): Likewise. (struct macro_table) <redef_ok>: New field. (macro_allow_redefinitions): New function. (new_macro_table): Update. (macro_define_function): Likewise. (macro_define_object): Likewise. * macroscope.c (user_macro_scope): New function. (default_macro_scope): Use it. (macro_user_macros): New global. (standard_macro_lookup): Look in macro_user_macros. (_initialize_macroscope): New function. * macroexp.h (macro_is_whitespace, macro_is_digit, macro_is_identifier_nondigit): Declare. * macroexp.c (macro_is_whitespace): Rename. No longer static. (macro_is_digit): Likewise. (macro_is_identifier_nondigit): Likewise. (get_identifier): Update. (get_pp_number): Likewise. (get_token): Likewise. * macrocmd.c (skip_ws): New function. (extract_identifier): Likewise. (free_macro_definition_ptr): Likewise. (user_macros): Remove. (macro_define_command): Implement. (_initialize_macrocmd): Update. (macro_undef_command): Implement. (print_one_macro): New function. (macro_list_command): Implement. gdb/doc * gdb.texinfo (Macros): Update. Use @code rather than @command. gdb/testsuite * gdb.base/macscp.exp: Add macro tests.
Diffstat (limited to 'gdb/macroscope.h')
-rw-r--r--gdb/macroscope.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb/macroscope.h b/gdb/macroscope.h
index 4c288b50ebb..d81a760aad9 100644
--- a/gdb/macroscope.h
+++ b/gdb/macroscope.h
@@ -24,6 +24,9 @@
#include "symtab.h"
+/* The table of macros defined by the user. */
+extern struct macro_table *macro_user_macros;
+
/* All the information we need to decide which macro definitions are
in scope: a source file (either a main source file or an
#inclusion), and a line number in that file. */
@@ -39,12 +42,18 @@ struct macro_scope {
struct macro_scope *sal_macro_scope (struct symtab_and_line sal);
+/* Return a `struct macro_scope' object representing just the
+ user-defined macros. The result is allocated using xmalloc; the
+ caller is responsible for freeing it. */
+struct macro_scope *user_macro_scope (void);
+
/* Return a `struct macro_scope' object describing the scope the `macro
expand' and `macro expand-once' commands should use for looking up
macros. If we have a selected frame, this is the source location of
its PC; otherwise, this is the last listing position.
- If we have no macro information for the current location, return zero.
+ If we have no macro information for the current location, return
+ the user macro scope.
The object returned is allocated using xmalloc; the caller is
responsible for freeing it. */