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.
2018-05-04 Tom Tromey <tom@tromey.com>
2018-05-04 Tom Tromey <tom@tromey.com>
+ PR gdb/22619:
+ * printcmd.c (last_count): New global.
+ (x_command): Use saved count when repeating.
+
+2018-05-04 Tom Tromey <tom@tromey.com>
+
* nto-procfs.c (do_closedir_cleanup): Remove.
(procfs_pidlist): Use gdb_dir_up.
* procfs.c (do_closedir_cleanup): Remove.
* nto-procfs.c (do_closedir_cleanup): Remove.
(procfs_pidlist): Use gdb_dir_up.
* procfs.c (do_closedir_cleanup): Remove.
static char last_size = 'w';
static char last_size = 'w';
+/* Last specified count for the 'x' command. */
+
+static int last_count;
+
/* Default address to examine next, and associated architecture. */
static struct gdbarch *next_gdbarch;
/* Default address to examine next, and associated architecture. */
static struct gdbarch *next_gdbarch;
fmt.count = 1;
fmt.raw = 0;
fmt.count = 1;
fmt.raw = 0;
+ /* If there is no expression and no format, use the most recent
+ count. */
+ if (exp == nullptr && last_count > 0)
+ fmt.count = last_count;
+
if (exp && *exp == '/')
{
const char *tmp = exp + 1;
if (exp && *exp == '/')
{
const char *tmp = exp + 1;
+ last_count = fmt.count;
+
/* If we have an expression, evaluate it and use it as the address. */
if (exp != 0 && *exp != 0)
/* If we have an expression, evaluate it and use it as the address. */
if (exp != 0 && *exp != 0)
+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'
2018-05-04 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.base/maint.exp: Process output from 'maint print registers'
gdb_test "x/2gc g" "-17 '.\[0-9\]*'.*119 'w'"
gdb_test "x/2gf g" "3.5127005640885037e-303.*-5.9822653797615723e-120"
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"
+