]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use CLR DWARF register and PCC/CSP
authorLuis Machado <luis.machado@arm.com>
Fri, 6 Nov 2020 01:50:42 +0000 (22:50 -0300)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 1 Sep 2022 22:53:23 +0000 (15:53 -0700)
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  <luis.machado@arm.com>

* 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/aarch64-tdep.c

index 8788097ba5cb8b503ddd96074048ace0993688f3..4834c77ef6f4cbc0c66a3a7fba14fc0c1bccf5bf 100644 (file)
@@ -2617,10 +2617,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);
 
@@ -4440,6 +4436,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);