aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVictor Do Nascimento <victor.donascimento@arm.com>2023-10-02 09:51:27 +0100
committerVictor Do Nascimento <victor.donascimento@arm.com>2023-10-04 12:21:53 +0100
commit1bf6696b594193c457091b90f7773f6b289b5dc4 (patch)
tree45b9aae240c3521008d7ee95e56fc204eb5308a8 /include
parent1181bcd0d2572aee2c0947040e56bc1f9af634e3 (diff)
downloadgdb-1bf6696b594193c457091b90f7773f6b289b5dc4.zip
gdb-1bf6696b594193c457091b90f7773f6b289b5dc4.tar.gz
gdb-1bf6696b594193c457091b90f7773f6b289b5dc4.tar.bz2
aarch64: system register aliasing detection
This patch adds a mechanism for system register name alias detection to register-matching mechanisms. A new `F_REG_ALIAS' flag is added to the set of register flags and used to label which entries in aarch64_sys_regs[] correspond to aliases (and thus which CPENC values are non-unique in this array). Where this is used is, for example, in `aarch64_print_operand' where, in the case of system register decoding, the aarch64_sys_regs[] array is iterated through until a match in CPENC value is made and the first match accepted. If insufficient care is given in the ordering of system registers in this array, the alias is encountered before the "real" register and used incorrectly as the register name in the disassembled output. With this flag and the new `aarch64_sys_reg_alias_p' test, search candidates corresponding to aliases can be conveniently skipped over. One concrete example of where this is useful is with the `trcextinselr0' system register. It was initially placed in the system register list before `trcextinselr', in contrast to a more natural alphabetical order. include/ChangeLog: * opcode/aarch64.h: add `aarch64_sys_reg_alias_p' prototype. opcodes/ChangeLog: * aarch64-opc.c (aarch64_sys_reg_alias_p): New. (aarch64_print_operand): add aarch64_sys_reg_alias_p check. (aarch64_sys_regs): Add F_REG_ALIAS flag to "trcextinselr" entry. * aarch64-opc.h (F_REG_ALIAS): New.
Diffstat (limited to 'include')
-rw-r--r--include/opcode/aarch64.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/opcode/aarch64.h b/include/opcode/aarch64.h
index ab42aca..d4ec60c 100644
--- a/include/opcode/aarch64.h
+++ b/include/opcode/aarch64.h
@@ -1240,6 +1240,7 @@ typedef struct
extern const aarch64_sys_reg aarch64_sys_regs [];
extern const aarch64_sys_reg aarch64_pstatefields [];
extern bool aarch64_sys_reg_deprecated_p (const uint32_t);
+extern bool aarch64_sys_reg_alias_p (const uint32_t);
extern bool aarch64_pstatefield_supported_p (const aarch64_feature_set,
const aarch64_sys_reg *);