aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/remote.exp
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2022-04-21 11:16:18 +0100
committerAndrew Burgess <aburgess@redhat.com>2022-04-21 17:25:46 +0100
commit5f21c7aae2040f3463d1ff56a4b0bcdbba34832d (patch)
treec3faa26bc16f1e82ea3df7af5c41cf12035ee397 /gdb/testsuite/gdb.base/remote.exp
parentffaebc199ed7b1f7e539c938e8b234d2a4ad9df9 (diff)
downloadfsf-binutils-gdb-5f21c7aae2040f3463d1ff56a4b0bcdbba34832d.zip
fsf-binutils-gdb-5f21c7aae2040f3463d1ff56a4b0bcdbba34832d.tar.gz
fsf-binutils-gdb-5f21c7aae2040f3463d1ff56a4b0bcdbba34832d.tar.bz2
gdb: fix 'remote show FOO-packet' aliases
The following behaviour was observed in GDB: (gdb) show remote X-packet Support for the `p' packet is auto-detected, currently unknown. Note the message mentions the 'p' packet. This is a regression since this commit: commit 8579fd136a614985bd27f20539c7bb7c5a51287d Date: Mon Nov 8 14:58:46 2021 +0000 gdb/gdbsupport: make xstrprintf and xstrvprintf return a unique_ptr Before this commit the behaviour was: (gdb) show remote X-packet Support for the `X' packet is auto-detected, currently unknown. The problem was caused by a failed attempt to ensure that some allocated strings were deleted when GDB exits. The code in the above commit attempted to make use of 'static' to solve this problem, however, the solution was just wrong. In this new commit I instead allocate a static vector into which all the allocated strings are stored, this ensures the strings are released when GDB exits (which makes output from tools like valgrind cleaner), but each string within the vector can be unique, which fixes the regression.
Diffstat (limited to 'gdb/testsuite/gdb.base/remote.exp')
-rw-r--r--gdb/testsuite/gdb.base/remote.exp5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/remote.exp b/gdb/testsuite/gdb.base/remote.exp
index 1f08694..579dcd4 100644
--- a/gdb/testsuite/gdb.base/remote.exp
+++ b/gdb/testsuite/gdb.base/remote.exp
@@ -195,4 +195,9 @@ gdb_test_no_output "set remote hardware-breakpoint-limit -1"
gdb_test_no_output "set remote hardware-watchpoint-limit 2147483647"
gdb_test_no_output "set remote hardware-breakpoint-limit 2147483647"
+# Check the X/P/p alias commands display the correct packet names.
+foreach pkt {X P p} {
+ gdb_test "show remote ${pkt}-packet" "Support for the `${pkt}' packet is.*"
+}
+
gdb_exit