aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2021-01-08 10:27:58 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2021-01-08 15:30:18 +0000
commitd00f086803f2213bf4406278cd3e83d935e27096 (patch)
tree6a6a0ce352e24d42dc7e71aaab95d7a74ec3337a /gdb
parented20522215641bf3cd35929eef578a89ac07fa37 (diff)
downloadbinutils-d00f086803f2213bf4406278cd3e83d935e27096.zip
binutils-d00f086803f2213bf4406278cd3e83d935e27096.tar.gz
binutils-d00f086803f2213bf4406278cd3e83d935e27096.tar.bz2
gdb: add missing test for completion of invalid /FMT strings
This commit: commit 3df8c6afdd6d38a7622ff5f4b1a64aff80334ab9 Date: Fri Nov 27 10:46:07 2020 +0000 gdb: fix potentially uninitialised variable Was pushed with no test. Naughty! The new test checks how GDB behaves when completing an invalid /FMT string. Currently GDB does no validation of the /FMT string during tab completion, and just assumes that any /FMT string is valid and complete when the user hits TAB. So: (gdb) p/@@<TAB> Will give: (gdb) p/@@ <CURSOR IS HERE> We already had a test in place for completion on a valid /FMT string, but the above commit fixed a bug in the logic for completing invalid /FMT strings. Now we have a test for this too. gdb/testsuite/ChangeLog: * gdb.base/completion.exp: Add a new test.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.base/completion.exp5
2 files changed, 9 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index c539057..0c5e360 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2021-01-08 Andrew Burgess <andrew.burgess@embecosm.com>
+ * gdb.base/completion.exp: Add a new test.
+
+2021-01-08 Andrew Burgess <andrew.burgess@embecosm.com>
+
* gdb.fortran/intvar-dynamic-types.exp: New file.
* gdb.fortran/intvar-dynamic-types.f90: New file.
diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp
index 98bca55..076134c 100644
--- a/gdb/testsuite/gdb.base/completion.exp
+++ b/gdb/testsuite/gdb.base/completion.exp
@@ -938,6 +938,11 @@ foreach_with_prefix spc { " " "" } {
test_gdb_complete_none "p${spc}/"
test_gdb_complete_unique "p${spc}/d" "p${spc}/d"
+ # Try completion on an invalid /FMT string. GDB doesn't attempt
+ # to validate the /FMT string during completion, the string is
+ # just assumed to be complete when the user hits TAB.
+ test_gdb_complete_unique "p${spc}/@" "p${spc}/@"
+
test_gdb_complete_unique "x${spc}/1w values\[0\].b"\
"x${spc}/1w values\[0\].b_field"