diff options
author | Tom Tromey <tromey@redhat.com> | 2008-07-18 20:55:33 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2008-07-18 20:55:33 +0000 |
commit | d7d9f01ea18f14a9a1574042bd65dd73f9b6b2b8 (patch) | |
tree | 350b57eb105730c6e52b961f7c55b0821f6b222e /gdb/doc | |
parent | a9dc948127c2cb5127cec5ca87dbc19f17dd16cf (diff) | |
download | gdb-d7d9f01ea18f14a9a1574042bd65dd73f9b6b2b8.zip gdb-d7d9f01ea18f14a9a1574042bd65dd73f9b6b2b8.tar.gz gdb-d7d9f01ea18f14a9a1574042bd65dd73f9b6b2b8.tar.bz2 |
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/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 40 |
2 files changed, 23 insertions, 21 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 8786b4a..3c6b66d 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,7 @@ +2008-07-18 Tom Tromey <tromey@redhat.com> + + * gdb.texinfo (Macros): Update. Use @code rather than @command. + 2008-07-10 Doug Evans <dje@google.com> * doc/gdb.texinfo: Document "set print symbol-loading on|off". diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 2920179..06d1db2 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -1,6 +1,6 @@ \input texinfo @c -*-texinfo-*- @c Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, -@c 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008 +@c 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 @c Free Software Foundation, Inc. @c @c %**start of header @@ -7923,31 +7923,29 @@ source location where that definition was established. @cindex macros, user-defined @item macro define @var{macro} @var{replacement-list} @itemx macro define @var{macro}(@var{arglist}) @var{replacement-list} -@i{(This command is not yet implemented.)} Introduce a definition for a -preprocessor macro named @var{macro}, invocations of which are replaced -by the tokens given in @var{replacement-list}. The first form of this -command defines an ``object-like'' macro, which takes no arguments; the -second form defines a ``function-like'' macro, which takes the arguments -given in @var{arglist}. - -A definition introduced by this command is in scope in every expression -evaluated in @value{GDBN}, until it is removed with the @command{macro -undef} command, described below. The definition overrides all -definitions for @var{macro} present in the program being debugged, as -well as any previous user-supplied definition. +Introduce a definition for a preprocessor macro named @var{macro}, +invocations of which are replaced by the tokens given in +@var{replacement-list}. The first form of this command defines an +``object-like'' macro, which takes no arguments; the second form +defines a ``function-like'' macro, which takes the arguments given in +@var{arglist}. + +A definition introduced by this command is in scope in every +expression evaluated in @value{GDBN}, until it is removed with the +@code{macro undef} command, described below. The definition overrides +all definitions for @var{macro} present in the program being debugged, +as well as any previous user-supplied definition. @kindex macro undef @item macro undef @var{macro} -@i{(This command is not yet implemented.)} Remove any user-supplied -definition for the macro named @var{macro}. This command only affects -definitions provided with the @command{macro define} command, described -above; it cannot remove definitions present in the program being -debugged. +Remove any user-supplied definition for the macro named @var{macro}. +This command only affects definitions provided with the @code{macro +define} command, described above; it cannot remove definitions present +in the program being debugged. @kindex macro list @item macro list -@i{(This command is not yet implemented.)} List all the macros -defined using the @code{macro define} command. +List all the macros defined using the @code{macro define} command. @end table @cindex macros, example of debugging with @@ -8026,7 +8024,7 @@ expands to: once (M + 1) (@value{GDBP}) @end smallexample -In the example above, note that @command{macro expand-once} expands only +In the example above, note that @code{macro expand-once} expands only the macro invocation explicit in the original text --- the invocation of @code{ADD} --- but does not expand the invocation of the macro @code{M}, which was introduced by @code{ADD}. |