diff options
author | Doug Evans <dje@google.com> | 2012-08-13 14:30:55 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2012-08-13 14:30:55 +0000 |
commit | d8037c4af5316234e59dd4166bebb57229de5cd0 (patch) | |
tree | 222bacc60f34f3568bce9fd38cbe0c8ea8731b72 | |
parent | ae1a9a25e6c71e1b584eceecc87b3fff16e5f70e (diff) | |
download | gdb-d8037c4af5316234e59dd4166bebb57229de5cd0.tar.gz |
* value.c (show_convenience): Tweak comment.
(_initialize_values): Mention convenience functions in the help text
for "show convenience".
doc/
* gdb.texinfo (Convenience Vars): Update text for "show convenience"
to include functions.
testsuite/
* gdb.base/default.exp: Update expected output of "show convenience".
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/doc/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 5 | ||||
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/default.exp | 22 | ||||
-rw-r--r-- | gdb/value.c | 30 |
6 files changed, 55 insertions, 17 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5efe533bb76..ea6f62b80e9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2012-08-13 Doug Evans <dje@google.com> + + * value.c (show_convenience): Tweak comment. + (_initialize_values): Mention convenience functions in the help text + for "show convenience". + 2012-08-13 Yao Qi <yao@codesourcery.com> * std-operator.def: Remove TERNOP_SLICE_COUNT. diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 4318d8416b6..661d933c7b5 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2012-08-13 Doug Evans <dje@google.com> + + * gdb.texinfo (Convenience Vars): Update text for "show convenience" + to include functions. + 2012-08-10 Doug Evans <dje@google.com> * gdb.texinfo (Convenience Funs): New node. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 5cc5b48780d..5cb8c8edf24 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -9225,9 +9225,10 @@ variable, when used as an expression, has the type of its current value. @table @code @kindex show convenience -@cindex show all user variables +@cindex show all user variables and functions @item show convenience -Print a list of convenience variables used so far, and their values. +Print a list of convenience variables used so far, and their values, +as well as a list of the convenience functions. Abbreviated @code{show conv}. @kindex init-if-undefined diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 27fe40ce369..106832a2b1c 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2012-08-13 Doug Evans <dje@google.com> + + * gdb.base/default.exp: Update expected output of "show convenience". + 2012-08-10 Doug Evans <dje@google.com> * gdb.python/py-strfns.c: New file. diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp index 138cc03e98e..5a73fcc160a 100644 --- a/gdb/testsuite/gdb.base/default.exp +++ b/gdb/testsuite/gdb.base/default.exp @@ -595,11 +595,10 @@ gdb_test "show complaints" "Max number of complaints about incorrect symbols is gdb_test "show confirm" "Whether to confirm potentially dangerous operations is o\[a-z\]*." "show confirm" #test show convenience -# This is tricker as there are multiple internal convenience vars and we -# can't assume any particular order. -gdb_test_list_exact "show convenience" "show convenience" \ - "\[^\r\n\]+\[\r\n\]+" \ - "\[^\r\n\]+" \ +# This is trickier as there are multiple internal convenience vars and +# functions and we can't assume any particular order. +# And we have to handle the extra convenience funs provided by Python. +set show_conv_list \ { \ {$_sdata = void} \ {$_siginfo = void} \ @@ -618,6 +617,19 @@ gdb_test_list_exact "show convenience" "show convenience" \ {$_probe_arg10 = <error: No frame selected>} \ {$_probe_arg11 = <error: No frame selected>} \ } +if ![skip_python_tests] { + append show_conv_list \ + { + {$_memeq = <internal function _memeq>} \ + {$_regex = <internal function _regex>} \ + {$_streq = <internal function _streq>} \ + {$_strlen = <internal function _strlen>} \ + } +} +gdb_test_list_exact "show convenience" "show convenience" \ + "\[^\r\n\]+\[\r\n\]+" \ + "\[^\r\n\]+" \ + $show_conv_list #test show directories gdb_test "show directories" "Source directories searched: .cdir\[:;\].cwd" "show directories" diff --git a/gdb/value.c b/gdb/value.c index a6bb71865bd..ae44ebab313 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -2255,11 +2255,17 @@ show_convenience (char *ignore, int from_tty) printf_filtered (("\n")); } if (!varseen) - printf_unfiltered (_("No debugger convenience variables now defined.\n" - "Convenience variables have " - "names starting with \"$\";\n" - "use \"set\" as in \"set " - "$foo = 5\" to define them.\n")); + { + /* This text does not mention convenience functions on purpose. + The user can't create them except via Python, and if Python support + is installed this message will never be printed ($_streq will + exist). */ + printf_unfiltered (_("No debugger convenience variables now defined.\n" + "Convenience variables have " + "names starting with \"$\";\n" + "use \"set\" as in \"set " + "$foo = 5\" to define them.\n")); + } } /* Extract a value as a C number (either long or double). @@ -3363,14 +3369,18 @@ void _initialize_values (void) { add_cmd ("convenience", no_class, show_convenience, _("\ -Debugger convenience (\"$foo\") variables.\n\ -These variables are created when you assign them values;\n\ -thus, \"print $foo=1\" gives \"$foo\" the value 1. Values may be any type.\n\ +Debugger convenience (\"$foo\") variables and functions.\n\ +Convenience variables are created when you assign them values;\n\ +thus, \"set $foo=1\" gives \"$foo\" the value 1. Values may be any type.\n\ \n\ A few convenience variables are given values automatically:\n\ \"$_\"holds the last address examined with \"x\" or \"info lines\",\n\ -\"$__\" holds the contents of the last address examined with \"x\"."), - &showlist); +\"$__\" holds the contents of the last address examined with \"x\"." +#ifdef HAVE_PYTHON +"\n\n\ +Convenience functions are defined via the Python API." +#endif + ), &showlist); add_cmd ("values", no_set_class, show_values, _("\ Elements of value history around item number IDX (or last ten)."), |