diff options
author | Tom de Vries <tdevries@suse.de> | 2021-01-19 13:31:12 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2021-01-19 13:31:12 +0100 |
commit | 148521232871c8017c973b3c0cc29c8ac7b96134 (patch) | |
tree | 872eed9f1dc0af8f2d6ea793dc7944dbd8dea24d /ltgcc.m4 | |
parent | 0c4e2c6c88e9e67ca39f4f2e3bdb205b4f4a1e6c (diff) | |
download | gdb-148521232871c8017c973b3c0cc29c8ac7b96134.zip gdb-148521232871c8017c973b3c0cc29c8ac7b96134.tar.gz gdb-148521232871c8017c973b3c0cc29c8ac7b96134.tar.bz2 |
[gdb/testsuite] Fix gdb.base/step-over-syscall.exp with -m32
When executing test-case gdb.base/step-over-syscall.exp with target board
unix/-m32, we run into:
...
(gdb) x/2i $pc^M
=> 0xf7fd5155 <__kernel_vsyscall+5>: sysenter ^M
0xf7fd5157 <__kernel_vsyscall+7>: int $0x80^M
(gdb) PASS: gdb.base/step-over-syscall.exp: fork: displaced=off: \
pc before/after syscall instruction
stepi^M
[Detaching after fork from child process 23593]^M
0xf7fd5159 in __kernel_vsyscall ()^M
1: x/i $pc^M
=> 0xf7fd5159 <__kernel_vsyscall+9>: pop %ebp^M
(gdb) PASS: gdb.base/step-over-syscall.exp: fork: displaced=off: stepi fork insn
print /x $pc^M
$2 = 0xf7fd5159^M
(gdb) PASS: gdb.base/step-over-syscall.exp: fork: displaced=off: pc after stepi
FAIL: gdb.base/step-over-syscall.exp: fork: displaced=off: \
pc after stepi matches insn addr after syscall
...
The test tries to verify that after doing a stepi at a syscall insn, the $pc
is matching the insn after the syscall insn.
However, in the case that the syscall insn is "sysenter", the stepi will land
further away, so in this case:
...
0xf7fd5155 <__kernel_vsyscall+5>: sysenter ^M
0xf7fd5157 <__kernel_vsyscall+7>: int $0x80^M
0xf7fd5159 <__kernel_vsyscall+9>: pop %ebp^M
...
the stepi will land at 0xf7fd5159 instead of 0xf7fd5157.
Fix this by detecting the sysenter/int sequence and adjusting the expected
pc.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2021-01-19 Tom de Vries <tdevries@suse.de>
* gdb.base/step-over-syscall.exp: Detect and handle sysenter/int
sequence.
Diffstat (limited to 'ltgcc.m4')
0 files changed, 0 insertions, 0 deletions