aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.arch
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2024-08-29 07:31:12 +0200
committerTom de Vries <tdevries@suse.de>2024-08-29 07:31:12 +0200
commitb55b65bc56604e45fae38dea9a22eeb3ffa2b33e (patch)
treebe8f6130019acf739a315bcd0777705e5b8195b1 /gdb/testsuite/gdb.arch
parent5cca20f614694ba6af3c10ca5bb93c32cdb9522b (diff)
downloadgdb-b55b65bc56604e45fae38dea9a22eeb3ffa2b33e.zip
gdb-b55b65bc56604e45fae38dea9a22eeb3ffa2b33e.tar.gz
gdb-b55b65bc56604e45fae38dea9a22eeb3ffa2b33e.tar.bz2
[gdb/testsuite] Fix regexp in gdb.arch/i386-disp-step-self-call.exp
Usually, with test-case gdb.arch/i386-disp-step-self-call.exp I get: ... (gdb) x/1wx 0xffffc4f8^M 0xffffc4f8: 0x08048472^M (gdb) PASS: $exp: check return address was updated correctly ... but sometimes I run into: ... (gdb) x/1wx 0xffffc5c8^M 0xffffc5c8: 0x0804917e^M (gdb) FAIL: $exp: check return address was updated correctly ... The problem is that here: ... set next_insn_addr 0x[format %08X $next_insn_addr] gdb_test "x/1wx 0x[format %x $sp]" "$hex:\\s+$next_insn_addr" \ "check return address was updated correctly" ... we're trying to match string 0x0804917e against regexp 0x0804917E due to using "%08X" as format string. We only run into this problem if the address contains letters, which apparently usually isn't the case. Fix this by using "%08x" instead as format string. Likewise in test-case gdb.arch/amd64-disp-step-self-call.exp. Tested on x86_64-linux. PR testsuite/32121 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32121
Diffstat (limited to 'gdb/testsuite/gdb.arch')
-rw-r--r--gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp2
-rw-r--r--gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp2
2 files changed, 2 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp b/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp
index 762d19a..2db3ff2 100644
--- a/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp
+++ b/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp
@@ -77,6 +77,6 @@ gdb_assert {[expr $sp == $new_sp]} \
"check stack pointer was updated as expected"
# Check the contents of the stack were updated to the expected value.
-set next_insn_addr 0x[format %016X $next_insn_addr]
+set next_insn_addr 0x[format %016x $next_insn_addr]
gdb_test "x/1gx 0x[format %x $sp]" "$hex:\\s+$next_insn_addr" \
"check return address was updated correctly"
diff --git a/gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp b/gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp
index b2cb902..5de7ebc 100644
--- a/gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp
+++ b/gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp
@@ -77,6 +77,6 @@ gdb_assert {[expr $sp == $new_sp]} \
"check stack pointer was updated as expected"
# Check the contents of the stack were updated to the expected value.
-set next_insn_addr 0x[format %08X $next_insn_addr]
+set next_insn_addr 0x[format %08x $next_insn_addr]
gdb_test "x/1wx 0x[format %x $sp]" "$hex:\\s+$next_insn_addr" \
"check return address was updated correctly"