[PATCH v0 04/13] aarch64: improve debuggability on array of enum

Matthieu Longo matthieu.longo@arm.com
Mon Jul 8 12:34:43 GMT 2024


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.
---
 include/opcode/aarch64.h | 6 +++---
 opcodes/aarch64-opc.c    | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: v0-0004-aarch64-improve-debuggability-on-array-of-enum.patch
Type: text/x-patch
Size: 1932 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20240708/0063d7f0/attachment.bin>


More information about the Binutils mailing list