diff options
author | Andrew Stubbs <andrew.stubbs@st.com> | 2005-12-02 11:44:19 +0000 |
---|---|---|
committer | Andrew Stubbs <andrew.stubbs@st.com> | 2005-12-02 11:44:19 +0000 |
commit | 53e5f3cf290c7591f459743845dd24391d72796c (patch) | |
tree | d9f312a1cadb7b3c7cd22f9a9fec6699f4f68531 /gdb/doc | |
parent | 0430b0d6a5e6aab360f81c68df76b794d4e6326b (diff) | |
download | gdb-53e5f3cf290c7591f459743845dd24391d72796c.zip gdb-53e5f3cf290c7591f459743845dd24391d72796c.tar.gz gdb-53e5f3cf290c7591f459743845dd24391d72796c.tar.bz2 |
2005-12-02 Andrew Stubbs <andrew.stubbs@st.com>
* value.c (init_if_undefined_command): New function.
(_initialize_values): Add command init-if-undefined.
* NEWS (Changes since GDB 6.3): Rename to 'Changes in GDB 6.4'.
(Changes since GDB 6.4): New section.
Mention new command init-if-undefined.
doc/
* gdb.texinfo (Convenience variables): Add init-if-undefined command.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 3f070f3..d62231d 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,7 @@ +2005-12-02 Andrew Stubbs <andrew.stubbs@st.com> + + * gdb.texinfo (Convenience variables): Add init-if-undefined command. + 2005-11-25 Joel Brobecker <brobecker@adacore.com> * gdbint.texinfo (Start of New Year Procedure): New chapter. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index fef2595..2eb1dd8 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -6131,6 +6131,18 @@ variable, when used as an expression, has the type of its current value. @item show convenience Print a list of convenience variables used so far, and their values. Abbreviated @code{show conv}. + +@kindex init-if-undefined +@cindex convenience variables, initializing +@item init-if-undefined $@var{variable} = @var{expression} +Set a convenience variable if it has not already been set. This is useful +for user-defined commands that keep some state. It is similar, in concept, +to using local static variables with initializers in C (except that +convenience variables are global). It can also be used to allow users to +override default values used in a command script. + +If the variable is already defined then the expression is not evaluated so +any side-effects do not occur. @end table One of the ways to use a convenience variable is as a counter to be |