diff options
author | Matthieu Longo <matthieu.longo@arm.com> | 2024-06-07 16:59:57 +0100 |
---|---|---|
committer | Matthieu Longo <matthieu.longo@arm.com> | 2024-11-08 11:35:46 +0000 |
commit | 46dace1933f6e9c367edb97c60c23bdac9d040b3 (patch) | |
tree | 9ed70b913ab4106f56e4d6662db9476fab7db286 /include | |
parent | c703d0aff58d887a54264445321af0fda032550e (diff) | |
download | binutils-46dace1933f6e9c367edb97c60c23bdac9d040b3.zip binutils-46dace1933f6e9c367edb97c60c23bdac9d040b3.tar.gz binutils-46dace1933f6e9c367edb97c60c23bdac9d040b3.tar.bz2 |
aarch64: improve debuggability on array of enum
The current space optmization on enum aarch64_opn_qualifier forced its
encoding using an unsigned char. This "hard-coded" optimization has the
bad consequence of making the array of such enums being completely
unreadable when debugging with GDB because the enum type is lost along
the way.
Keeping this space optimization, and the enum type as well, is possible
when the declaration of the enum is tagged with attribute((packed)).
attribute((packed)) is a GNU extension, and is wrapped in the macro
ATTRIBUTE_PACKED (defined in ansidecl.h), and should be used instead.
Diffstat (limited to 'include')
-rw-r--r-- | include/opcode/aarch64.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/opcode/aarch64.h b/include/opcode/aarch64.h index b258531..a964d64 100644 --- a/include/opcode/aarch64.h +++ b/include/opcode/aarch64.h @@ -984,7 +984,7 @@ enum aarch64_opnd_qualifier /* Special qualifier used for indicating error in qualifier retrieval. */ AARCH64_OPND_QLF_ERR, -}; +} ATTRIBUTE_PACKED; /* Instruction class. */ @@ -1235,8 +1235,8 @@ enum err_type #define AARCH64_MAX_OPND_NUM 7 /* Maximum number of qualifier sequences an instruction can have. */ #define AARCH64_MAX_QLF_SEQ_NUM 10 -/* Operand qualifier typedef; optimized for the size. */ -typedef unsigned char aarch64_opnd_qualifier_t; +/* Operand qualifier typedef */ +typedef enum aarch64_opnd_qualifier aarch64_opnd_qualifier_t; /* Operand qualifier sequence typedef. */ typedef aarch64_opnd_qualifier_t \ aarch64_opnd_qualifier_seq_t [AARCH64_MAX_OPND_NUM]; |