From: Luis Machado Date: Wed, 10 Mar 2021 13:16:56 +0000 (-0300) Subject: Fix extracting tags from PCC and CSP X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4353c8e3fa6fb5bd28a43a949e32e27be3ecc575;p=thirdparty%2Fbinutils-gdb.git Fix extracting tags from PCC and CSP The tags for PCC/CSP are stored in the order of struct user_morello_state. Make sure we account for that when extracting the tags. gdb/ChangeLog: 2021-03-17 Luis Machado * aarch64-tdep.c (aarch64_register_tag): Handle PCC/CSP tag extraction. --- diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 14531b27009..e4ac51a00ab 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -4189,6 +4189,16 @@ aarch64_register_tag (struct gdbarch *gdbarch, regnum > tdep->cap_reg_last - 2) return false; + /* The CSP/PCC tags are swapped in the tag_map because the ordering of CSP/PCC + in struct user_morello_state is different from GDB's register description. + + Make sure we account for that when extracting the tag from those + registers. */ + if (regnum == tdep->cap_reg_pcc) + regnum = tdep->cap_reg_csp; + else if (regnum == tdep->cap_reg_csp) + regnum = tdep->cap_reg_pcc; + /* Find the proper bit within the tag_map. */ int shift = regnum - tdep->cap_reg_base; ULONGEST tag_map = 0;