diff options
author | Yichao Yu <yyc1992@gmail.com> | 2022-05-18 15:00:00 +0100 |
---|---|---|
committer | Luis Machado <luis.machado@arm.com> | 2022-05-18 15:42:23 +0100 |
commit | 1fe8486103e482bcd6cd74fdbf79a7d2ab9b111f (patch) | |
tree | 7242486ba0048cfea539d7428c362844f6e5be3e /gdb/aarch64-tdep.c | |
parent | 4bb8b8e9381bce9734454470ebd1572534e7514e (diff) | |
download | binutils-1fe8486103e482bcd6cd74fdbf79a7d2ab9b111f.zip binutils-1fe8486103e482bcd6cd74fdbf79a7d2ab9b111f.tar.gz binutils-1fe8486103e482bcd6cd74fdbf79a7d2ab9b111f.tar.bz2 |
[AArch64] Return the regnum for PC (32) on aarch64
This will allow the unwind info to explicitly specify a different value
for the return address from the link register.
Such usage, although uncommon, is valid and useful for signal frames.
It is also supported by aadwarf64 from ARM (Note 9 in [1]).
Ref https://sourceware.org/pipermail/gdb/2022-May/050091.html
[1] https://github.com/ARM-software/abi-aa/blob/2022Q1/aadwarf64/aadwarf64.rst#dwarf-register-names
Signed-off-by: Luis Machado <luis.machado@arm.com>
Diffstat (limited to 'gdb/aarch64-tdep.c')
-rw-r--r-- | gdb/aarch64-tdep.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index d0995bb..c3abd3a 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -2219,6 +2219,9 @@ aarch64_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg) if (reg == AARCH64_DWARF_SP) return AARCH64_SP_REGNUM; + if (reg == AARCH64_DWARF_PC) + return AARCH64_PC_REGNUM; + if (reg >= AARCH64_DWARF_V0 && reg <= AARCH64_DWARF_V0 + 31) return AARCH64_V0_REGNUM + reg - AARCH64_DWARF_V0; |