diff options
author | Sébastien Michelland <sebastien.michelland@lcis.grenoble-inp.fr> | 2024-04-01 11:55:53 +0200 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2024-04-26 09:48:12 -0400 |
commit | afdd600c0982f0ce95439f2936c6d6d6d0201f77 (patch) | |
tree | 19ddcb3425c0f49891730e84aa4d95966c3beecc /gdb/testsuite/gdb.python | |
parent | 6fde04116b4b835fa9ec3b3497fcac4e4a0637e2 (diff) | |
download | binutils-afdd600c0982f0ce95439f2936c6d6d6d0201f77.zip binutils-afdd600c0982f0ce95439f2936c6d6d6d0201f77.tar.gz binutils-afdd600c0982f0ce95439f2936c6d6d6d0201f77.tar.bz2 |
gdb: specify sh pointer register types
This patch fixes a pretty funny issue on sh targets that occurred
because $pc (and similar registers) were typed as int. When $pc is in
the upper half of the address space (i.e. kernel code on sh), `x/i $pc'
would resolve to a negative value. At least in the case of a remote
target with an Xfer memory map, this leads to a spurious "cannot access
memory" error as negative addresses are out of bounds.
(gdb) x/i $pc
0x8c202c04: Cannot access memory at address 0x8c202c04
(gdb) x/i 0x8c202c04
=> 0x8c202c04 <gintctl_gint_gdb+304>: mov.l @r1,r10
The issue is fixed by specifying pointer types for pc and other pointer
registers. Code pointer registers on sh include pc, pr (return address
of a call), vbr (interrupt handler) and spc (return address after
interrupt). Data pointers include r15 (stack pointer) and gbr (base
register for a few specific addressing modes).
Change-Id: I043a058f7cbc6494f380dc0461616a9f3e0d87e0
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/testsuite/gdb.python')
0 files changed, 0 insertions, 0 deletions