From c03396afe61f5e01f07287a1c7dcb6effab2bb0d Mon Sep 17 00:00:00 2001 From: Luis Machado Date: Thu, 5 Nov 2020 22:50:42 -0300 Subject: [PATCH] Use CLR DWARF register and PCC/CSP Remove code to return LR for a CLR DWARF register. For the pure capability ABI, set pc to PCC and sp to CSP. gdb/ChangeLog: 2020-11-11 Luis Machado * aarch64-tdep.c (aarch64_dwarf_reg_to_regnum): Don't return LR for CLR. (aarch64_gdbarch_init): Set pc to PCC and sp to CSP for pure cap ABI. --- gdb/ChangeLog | 7 +++++++ gdb/aarch64-tdep.c | 7 +++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 49963f5e74a..5971b23af91 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2020-11-11 Luis Machado + + * aarch64-tdep.c (aarch64_dwarf_reg_to_regnum): Don't return LR + for CLR. + (aarch64_gdbarch_init): Set pc to PCC and sp to CSP for pure cap + ABI. + 2020-11-11 Luis Machado * c-valprint.c (c_value_print_ptr): Adjust to print capability diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index e30a61e6a6c..14b46e85c8c 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -2580,10 +2580,6 @@ aarch64_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg) if (tdep->has_capability ()) { - /* FIXME-Morello: Redirect CLR to LR for now. */ - if (reg == AARCH64_DWARF_CLR) - return AARCH64_LR_REGNUM; - if (reg >= AARCH64_DWARF_C0 && reg <= AARCH64_DWARF_C0 + 30) return tdep->cap_reg_base + (reg - AARCH64_DWARF_C0); @@ -4331,6 +4327,9 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Set address class hooks for capabilities. */ if (feature_capability) { + set_gdbarch_sp_regnum (gdbarch, tdep->cap_reg_csp); + set_gdbarch_pc_regnum (gdbarch, tdep->cap_reg_pcc); + /* Address manipulation. */ set_gdbarch_addr_bits_remove (gdbarch, aarch64_addr_bits_remove); -- 2.47.3