AArch64: DWARF unwinder support for signed return addresses
authorAlan Hayward <alan.hayward@arm.com>
Fri, 22 Mar 2019 10:39:11 +0000 (10:39 +0000)
committerAlan Hayward <alan.hayward@arm.com>
Fri, 22 Mar 2019 10:39:11 +0000 (10:39 +0000)
commit11e1b75f0696f6e406fe8ccc759bac2fbc8fc151
treeebfb580bc0d7ea7d1bddbc258f2f9f64d5690583
parent34dcc7cf95f756862bdfebb753ab2de39fec4c9e
AArch64: DWARF unwinder support for signed return addresses

Pauth address signing is enabled at binary compile time.  When enabled the
return addresses for functions may be mangled.  This patch adds functionality
to restore the original address for use in the DWARF unwinder.

DW_CFA_AARCH64_negate_ra_state in a binary indicates the toggling of address
signing between enabled and disabled.  Ensure the state is stored in the DWARF
register ra_state.

Ensure the pauth DWARF registers are initialised.

gdb/ChangeLog:

* aarch64-tdep.c (aarch64_frame_unmask_address): New function.
(aarch64_dwarf2_prev_register): Unmask PC value.
(aarch64_dwarf2_frame_init_reg): Init pauth registers.
(aarch64_execute_dwarf_cfa_vendor_op): Check for
DW_CFA_AARCH64_negate_ra_state.
(aarch64_gdbarch_init): Add aarch64_execute_dwarf_cfa_vendor_op.
gdb/ChangeLog
gdb/aarch64-tdep.c