diff options
author | Tom de Vries <tdevries@suse.de> | 2024-06-20 16:54:47 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-06-20 16:54:47 +0200 |
commit | 4429b54cc831e436d27ba6f0e3c417543c22f486 (patch) | |
tree | c4dce6b15076a3b00c3b8d73d0e932dc0d22bb0f /gdb/testsuite/gdb.rust/simple.exp | |
parent | 18e62b794632622c44684909edd447cf914eac44 (diff) | |
download | binutils-4429b54cc831e436d27ba6f0e3c417543c22f486.zip binutils-4429b54cc831e436d27ba6f0e3c417543c22f486.tar.gz binutils-4429b54cc831e436d27ba6f0e3c417543c22f486.tar.bz2 |
[gdb/testsuite] Fix gdb.python/py-format-address.exp on arm
When running test-case gdb.python/py-format-address.exp on arm-linux, I get:
...
(gdb) python print("Got: " + gdb.format_address(0x103dd))^M
Got: 0x103dd <main at py-format-address.c:30>^M
(gdb) FAIL: $exp: symbol_filename=on: gdb.format_address, \
result should have an offset
...
What is expected here is:
...
Got: 0x103dd <main+1 at py-format-address.c:30>^M
...
Main starts at main_addr:
...
(gdb) print /x &main^M
$1 = 0x103dc^M
...
and we obtained next_addr 0x103dd by adding 1 to it:
...
set next_addr [format 0x%x [expr $main_addr + 1]]
...
Adding 1 to $main_addr results in an address for a thumb function starting at
address 0x103dc, which is incorrect because main is an arm function (because
I'm running with target board unix/-marm).
At some point during the call to format_addr, arm_addr_bits_remove removes
the thumb bit, which causes the +1 offset to be dropped, causing the FAIL.
Fix this by using the address of the breakpoint on main, provided it's not at
the very start of main.
Tested on arm-linux.
PR testsuite/31452
Bug: https://www.sourceware.org/bugzilla/show_bug.cgi?id=31452
Diffstat (limited to 'gdb/testsuite/gdb.rust/simple.exp')
0 files changed, 0 insertions, 0 deletions