* 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".
This commit is contained in:
parent
35d0a16941
commit
f47f77df4e
|
@ -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>
|
2012-08-13 Yao Qi <yao@codesourcery.com>
|
||||||
|
|
||||||
* std-operator.def: Remove TERNOP_SLICE_COUNT.
|
* std-operator.def: Remove TERNOP_SLICE_COUNT.
|
||||||
|
|
|
@ -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>
|
2012-08-10 Doug Evans <dje@google.com>
|
||||||
|
|
||||||
* gdb.texinfo (Convenience Funs): New node.
|
* gdb.texinfo (Convenience Funs): New node.
|
||||||
|
|
|
@ -9225,9 +9225,10 @@ variable, when used as an expression, has the type of its current value.
|
||||||
|
|
||||||
@table @code
|
@table @code
|
||||||
@kindex show convenience
|
@kindex show convenience
|
||||||
@cindex show all user variables
|
@cindex show all user variables and functions
|
||||||
@item show convenience
|
@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}.
|
Abbreviated @code{show conv}.
|
||||||
|
|
||||||
@kindex init-if-undefined
|
@kindex init-if-undefined
|
||||||
|
|
|
@ -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>
|
2012-08-10 Doug Evans <dje@google.com>
|
||||||
|
|
||||||
* gdb.python/py-strfns.c: New file.
|
* gdb.python/py-strfns.c: New 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"
|
gdb_test "show confirm" "Whether to confirm potentially dangerous operations is o\[a-z\]*." "show confirm"
|
||||||
|
|
||||||
#test show convenience
|
#test show convenience
|
||||||
# This is tricker as there are multiple internal convenience vars and we
|
# This is trickier as there are multiple internal convenience vars and
|
||||||
# can't assume any particular order.
|
# functions and we can't assume any particular order.
|
||||||
gdb_test_list_exact "show convenience" "show convenience" \
|
# And we have to handle the extra convenience funs provided by Python.
|
||||||
"\[^\r\n\]+\[\r\n\]+" \
|
set show_conv_list \
|
||||||
"\[^\r\n\]+" \
|
|
||||||
{ \
|
{ \
|
||||||
{$_sdata = void} \
|
{$_sdata = void} \
|
||||||
{$_siginfo = void} \
|
{$_siginfo = void} \
|
||||||
|
@ -618,6 +617,19 @@ gdb_test_list_exact "show convenience" "show convenience" \
|
||||||
{$_probe_arg10 = <error: No frame selected>} \
|
{$_probe_arg10 = <error: No frame selected>} \
|
||||||
{$_probe_arg11 = <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
|
#test show directories
|
||||||
gdb_test "show directories" "Source directories searched: .cdir\[:;\].cwd" "show directories"
|
gdb_test "show directories" "Source directories searched: .cdir\[:;\].cwd" "show directories"
|
||||||
|
|
30
gdb/value.c
30
gdb/value.c
|
@ -2255,11 +2255,17 @@ show_convenience (char *ignore, int from_tty)
|
||||||
printf_filtered (("\n"));
|
printf_filtered (("\n"));
|
||||||
}
|
}
|
||||||
if (!varseen)
|
if (!varseen)
|
||||||
printf_unfiltered (_("No debugger convenience variables now defined.\n"
|
{
|
||||||
"Convenience variables have "
|
/* This text does not mention convenience functions on purpose.
|
||||||
"names starting with \"$\";\n"
|
The user can't create them except via Python, and if Python support
|
||||||
"use \"set\" as in \"set "
|
is installed this message will never be printed ($_streq will
|
||||||
"$foo = 5\" to define them.\n"));
|
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).
|
/* Extract a value as a C number (either long or double).
|
||||||
|
@ -3363,14 +3369,18 @@ void
|
||||||
_initialize_values (void)
|
_initialize_values (void)
|
||||||
{
|
{
|
||||||
add_cmd ("convenience", no_class, show_convenience, _("\
|
add_cmd ("convenience", no_class, show_convenience, _("\
|
||||||
Debugger convenience (\"$foo\") variables.\n\
|
Debugger convenience (\"$foo\") variables and functions.\n\
|
||||||
These variables are created when you assign them values;\n\
|
Convenience variables are created when you assign them values;\n\
|
||||||
thus, \"print $foo=1\" gives \"$foo\" the value 1. Values may be any type.\n\
|
thus, \"set $foo=1\" gives \"$foo\" the value 1. Values may be any type.\n\
|
||||||
\n\
|
\n\
|
||||||
A few convenience variables are given values automatically:\n\
|
A few convenience variables are given values automatically:\n\
|
||||||
\"$_\"holds the last address examined with \"x\" or \"info lines\",\n\
|
\"$_\"holds the last address examined with \"x\" or \"info lines\",\n\
|
||||||
\"$__\" holds the contents of the last address examined with \"x\"."),
|
\"$__\" holds the contents of the last address examined with \"x\"."
|
||||||
&showlist);
|
#ifdef HAVE_PYTHON
|
||||||
|
"\n\n\
|
||||||
|
Convenience functions are defined via the Python API."
|
||||||
|
#endif
|
||||||
|
), &showlist);
|
||||||
|
|
||||||
add_cmd ("values", no_set_class, show_values, _("\
|
add_cmd ("values", no_set_class, show_values, _("\
|
||||||
Elements of value history around item number IDX (or last ten)."),
|
Elements of value history around item number IDX (or last ten)."),
|
||||||
|
|
Loading…
Reference in New Issue