mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-31 01:45:52 +08:00
Unset gdbarch significant_addr_bit by default
This patch fixes a bug introduced by fix to AArch64 pointer tagging. In our fix for tagged pointer support our agreed approach was to sign extend user-space address after clearing tag bits. This is not same for all architectures and this patch allows sign extension for addresses on targets which specifically set significant_addr_bit. More information about patch that caused the issues and discussion around tagged pointer support can be found in links below: https://sourceware.org/ml/gdb-patches/2018-05/msg00000.html https://sourceware.org/ml/gdb-patches/2017-12/msg00159.html gdb/ChangeLog: 2018-05-31 Omair Javaid <omair.javaid@linaro.org> PR gdb/23210 * gdbarch.sh (significant_addr_bit): Default to zero when not set by target architecture. * gdbarch.c: Re-generated. * utils.c (address_significant): Update.
This commit is contained in:
@ -2708,10 +2708,11 @@ address_significant (gdbarch *gdbarch, CORE_ADDR addr)
|
||||
/* Clear insignificant bits of a target address and sign extend resulting
|
||||
address, avoiding shifts larger or equal than the width of a CORE_ADDR.
|
||||
The local variable ADDR_BIT stops the compiler reporting a shift overflow
|
||||
when it won't occur. */
|
||||
when it won't occur. Skip updating of target address if current target
|
||||
has not set gdbarch significant_addr_bit. */
|
||||
int addr_bit = gdbarch_significant_addr_bit (gdbarch);
|
||||
|
||||
if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
|
||||
if (addr_bit && (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT)))
|
||||
{
|
||||
CORE_ADDR sign = (CORE_ADDR) 1 << (addr_bit - 1);
|
||||
addr &= ((CORE_ADDR) 1 << addr_bit) - 1;
|
||||
|
Reference in New Issue
Block a user