diff options
author | Tom de Vries <tdevries@suse.de> | 2020-12-04 13:36:47 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2020-12-04 13:36:47 +0100 |
commit | f17727b3497a630b01dffd219cdc372a058be121 (patch) | |
tree | d972f1a0d938b3eb66905b4c489a5f6b7cca2a48 /gdb/python/py-arch.c | |
parent | a1499830feea0dc134e8b08d7cc5b6a52e370294 (diff) | |
download | binutils-f17727b3497a630b01dffd219cdc372a058be121.zip binutils-f17727b3497a630b01dffd219cdc372a058be121.tar.gz binutils-f17727b3497a630b01dffd219cdc372a058be121.tar.bz2 |
[gdb/testsuite] Fix count usage in gdb.reverse/insn-reverse.exp
Consider the test-case gdb.reverse/insn-reverse.exp.
After the loop setting count, the valid entries in various arrays range from 0
to $count - 1 inclusive.
Then $count is decremented:
...
incr count -1
...
after which the valid entries range from 0 to $count inclusive.
The first subsequent loop handles that properly:
...
for {set i $count} {$i >= 0} {incr i -1} {
...
but the following loop does not, because it treats $count as exclusive bound:
...
for {set i 0} {$i < $count} {incr i} {
...
Fix this by removing the incr, and using $count - 1 as starting value in the
first loop.
gdb/testsuite/ChangeLog:
2020-12-04 Tom de Vries <tdevries@suse.de>
* gdb.reverse/insn-reverse.exp: Fix count handling.
Diffstat (limited to 'gdb/python/py-arch.c')
0 files changed, 0 insertions, 0 deletions