aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-04-27 15:52:44 -0600
committerTom Tromey <tom@tromey.com>2018-05-04 12:22:37 -0600
commit9be2ae8fc6b908746d9d7ebaf77aec8abba5dd2c (patch)
tree38e6471f828844582b6f39bd627884aac9738409 /gdb/testsuite
parentf0b3976bdcd29e308bed185630a24806037a717c (diff)
downloadgdb-9be2ae8fc6b908746d9d7ebaf77aec8abba5dd2c.zip
gdb-9be2ae8fc6b908746d9d7ebaf77aec8abba5dd2c.tar.gz
gdb-9be2ae8fc6b908746d9d7ebaf77aec8abba5dd2c.tar.bz2
Use previous count when 'x' command is repeated
About the 'x' command, the manual says: If you use <RET> to repeat the 'x' command, the repeat count N is used again; the other arguments default as for successive uses of 'x'. However, PR gdb/22619 points out that this does not work. This patch fixes the problem. ChangeLog 2018-05-04 Tom Tromey <tom@tromey.com> PR gdb/22619: * printcmd.c (last_count): New global. (x_command): Use saved count when repeating. testsuite/ChangeLog 2018-05-04 Tom Tromey <tom@tromey.com> PR gdb/22619: * gdb.base/long_long.exp (gdb_test_long_long): Add test for repeat behavior.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.base/long_long.exp5
2 files changed, 11 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 73c4a2c..62fa5e0 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2018-05-04 Tom Tromey <tom@tromey.com>
+
+ PR gdb/22619:
+ * gdb.base/long_long.exp (gdb_test_long_long): Add test for repeat
+ behavior.
+
2018-05-04 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.base/maint.exp: Process output from 'maint print registers'
diff --git a/gdb/testsuite/gdb.base/long_long.exp b/gdb/testsuite/gdb.base/long_long.exp
index 85e08f0..b319c61 100644
--- a/gdb/testsuite/gdb.base/long_long.exp
+++ b/gdb/testsuite/gdb.base/long_long.exp
@@ -280,5 +280,10 @@ gdb_test_ptr "x/2ga g" "" "" "0x89abcdef.*0x77053977" "0x123456789abcdef.*0xa72e
gdb_test "x/2gc g" "-17 '.\[0-9\]*'.*119 'w'"
gdb_test "x/2gf g" "3.5127005640885037e-303.*-5.9822653797615723e-120"
+# Repeat behavior.
+gdb_test "x/2bx b" "0x01.*0xa7" "set up for repeat"
+send_gdb "\n"
+gdb_test "" "0x00.*0x00" "repeat x command"
+
gdb_exit
return 0