diff options
author | Tom Tromey <tromey@adacore.com> | 2022-11-18 09:04:39 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2022-11-28 06:48:43 -0700 |
commit | b70e9270fbafd43a3fece0c7dd52cabd70854dfd (patch) | |
tree | c439b062915062261abffad32093e4284e745813 /gdb/testsuite | |
parent | 76cd77dc729b03d6b33c683323594479e33a3f9a (diff) | |
download | binutils-b70e9270fbafd43a3fece0c7dd52cabd70854dfd.zip binutils-b70e9270fbafd43a3fece0c7dd52cabd70854dfd.tar.gz binutils-b70e9270fbafd43a3fece0c7dd52cabd70854dfd.tar.bz2 |
Fix crash in "document" command
PR cli/29800 points out that "document" will now crash when the
argument is an undefined command. This is a regression due to the
"document user-defined aliases" patch.
Approved-By: Joel Brobecker <brobecker@adacore.com>
Reviewed-By: Philippe Waroquiers <philippe.waroquiers@skynet.be>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29800
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/gdb.base/document.exp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/document.exp b/gdb/testsuite/gdb.base/document.exp index 2d8f6b8..6f42651 100644 --- a/gdb/testsuite/gdb.base/document.exp +++ b/gdb/testsuite/gdb.base/document.exp @@ -28,3 +28,7 @@ gdb_test_multiple "define do-document" "" { } gdb_test_no_output "do-document" "invoke do-document" gdb_test "help do-document" "usage: do-document" "invoke help do-document" + +# Test that document of a non-existing command prints an error. There +# was a regression at one point causing this to crash. +gdb_test "document nosuchcommand" "Undefined command: \"nosuchcommand\"\\." |