* value.c (show_convenience): Tweak comment.
authorDoug Evans <dje@google.com>
Mon, 13 Aug 2012 14:31:00 +0000 (14:31 +0000)
committerDoug Evans <dje@google.com>
Mon, 13 Aug 2012 14:31:00 +0000 (14:31 +0000)
(_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".

gdb/ChangeLog
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/default.exp
gdb/value.c

index 5efe533bb76fde55e8e03fafdef53fc1f6d356a5..ea6f62b80e9e8ffa5ca90e2bf38ad88f34f853d6 100644 (file)
@@ -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.
index 4318d8416b6bdb4215beb2ac77414a13ae70e96b..661d933c7b594453711af922edcd4af2cc64f146 100644 (file)
@@ -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.
index 5cc5b48780d5bb2d8635a301634914c0f6c06bfa..5cb8c8edf247f9b0ce26c6beb83b174048c86c17 100644 (file)
@@ -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
index 27fe40ce369b57cf2632acaf21e2e7f9720e08d6..106832a2b1c32f08adf771504d0571b10f890c91 100644 (file)
@@ -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.
index 138cc03e98ed70e8f6e4f281932563c04efc36e6..5a73fcc160a99c85e2fa182980edf3fffc6cf5b8 100644 (file)
@@ -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"
index a6bb71865bdc89771fb26e0a0c322c80d81a365f..ae44ebab31372479812c5335d89ed10825cf16ef 100644 (file)
@@ -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"));
+    }
 }
 \f
 /* 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)."),
This page took 0.081109 seconds and 4 git commands to generate.