Use previous count when 'x' command is repeated
authorTom Tromey <tom@tromey.com>
Fri, 27 Apr 2018 21:52:44 +0000 (15:52 -0600)
committerTom Tromey <tom@tromey.com>
Fri, 4 May 2018 18:22:37 +0000 (12:22 -0600)
commit9be2ae8fc6b908746d9d7ebaf77aec8abba5dd2c
tree38e6471f828844582b6f39bd627884aac9738409
parentf0b3976bdcd29e308bed185630a24806037a717c
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.
gdb/ChangeLog
gdb/printcmd.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/long_long.exp