This commit:
commit
cf141dd8ccd36efe833aae3ccdb060b517cc1112
Date: Wed Feb 22 12:15:34 2023 +0000
gdb: fix reg corruption from displaced stepping on amd64
Added two test scripts gdb.arch/amd64-disp-step-self-call.exp and
gdb.arch/i386-disp-step-self-call.exp. These scripts contained a test
that included a stack address in the test name, this makes it harder
to compare results between runs.
This commit gives the tests proper names that doesn't include an
address.
Also in gdb.arch/i386-disp-step-self-call.exp I noticed that we were
writing 8-bytes rather than 4 in order to clear the return address
entry on the stack. This is also fixed in this commit.
# Clear the slot on the stack and confirm it was set to zero.
set sp [expr $sp - 0x8]
-gdb_test_no_output "set {unsigned long long} $sp = 0"
+gdb_test_no_output "set {unsigned long long} $sp = 0" \
+ "clear stack slot"
set zero_val 0x[format %016x 0]
gdb_test "x/1gx 0x[format %x $sp]" "$hex:\\s+${zero_val}" \
"check return address slot was set to zero"
# Clear the slot on the stack and confirm it was set to zero.
set sp [expr $sp - 0x4]
-gdb_test_no_output "set {unsigned long long} $sp = 0"
+gdb_test_no_output "set {unsigned int} $sp = 0" \
+ "clear stack slot"
set zero_val 0x[format %08x 0]
gdb_test "x/1wx 0x[format %x $sp]" "$hex:\\s+${zero_val}" \
"check return address slot was set to zero"