diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-11-01 00:30:25 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-12-04 09:06:23 -0500 |
commit | e34e391824570f822e0122503efd484fae8437ff (patch) | |
tree | 99e79843d4d7012c96b9102e8f68b0dde9d663ce /gdb/testsuite | |
parent | a3e9c2f9da9ab84bb5f0d1e6dc7e99e6114ade39 (diff) | |
download | gdb-e34e391824570f822e0122503efd484fae8437ff.zip gdb-e34e391824570f822e0122503efd484fae8437ff.tar.gz gdb-e34e391824570f822e0122503efd484fae8437ff.tar.bz2 |
gdb: don't show deprecated aliases
I don't think it's very useful to show deprecated aliases to the
user. It encourages the user to use them, when the goal is the
opposite.
For example, before:
(gdb) help set index-cache enabled
set index-cache enabled, set index-cache off, set index-cache on
alias set index-cache off = set index-cache enabled off
alias set index-cache on = set index-cache enabled on
Enable the index cache.
When on, enable the use of the index cache.
(gdb) help set index-cache on
Warning: 'set index-cache on', an alias for the command 'set index-cache enabled', is deprecated.
Use 'set index-cache enabled on'.
set index-cache enabled, set index-cache off, set index-cache on
alias set index-cache off = set index-cache enabled off
alias set index-cache on = set index-cache enabled on
Enable the index cache.
When on, enable the use of the index cache.
After:
(gdb) help set index-cache enabled
Enable the index cache.
When on, enable the use of the index cache.
(gdb) help set index-cache on
Warning: 'set index-cache on', an alias for the command 'set index-cache enabled', is deprecated.
Use 'set index-cache enabled on'.
Enable the index cache.
When on, enable the use of the index cache.
Change-Id: I989b618a5ad96ba975367e9d16db95523cd57a4c
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/gdb.base/commands.exp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/commands.exp index 6785f95..1dca419 100644 --- a/gdb/testsuite/gdb.base/commands.exp +++ b/gdb/testsuite/gdb.base/commands.exp @@ -709,6 +709,27 @@ maintenance deprecate set qqq_aaa" file delete $file1 } +# Test that the help for a command does not show deprecated aliases. + +proc_with_prefix deprecated_command_alias_help_test {} { + gdb_test_multiline "define real_command" \ + "define real_command" "End with a line saying just \"end\".." \ + "print 1" "" \ + "end" "" + + gdb_test_no_output "alias alias_command = real_command" + gdb_test_no_output "alias alias_with_args_command = real_command 123" + + gdb_test "help real_command" \ + "real_command, alias_with_args_command, alias_command\r\n alias alias_with_args_command = real_command 123\r\nUser-defined." \ + "help real_command, before" + gdb_test_no_output "maintenance deprecate alias_command" + gdb_test_no_output "maintenance deprecate alias_with_args_command" + gdb_test "help real_command" \ + "User-defined." \ + "help real_command, after" +} + proc_with_prefix bp_deleted_in_command_test {} { global gdb_prompt @@ -1203,6 +1224,7 @@ user_defined_command_manyargs_test watchpoint_command_test test_command_prompt_position deprecated_command_test +deprecated_command_alias_help_test bp_deleted_in_command_test temporary_breakpoint_commands stray_arg0_test |