diff options
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 9 | ||||
-rw-r--r-- | opcodes/aarch64-dis.c | 27 | ||||
-rw-r--r-- | opcodes/aarch64-opc.c | 2 |
3 files changed, 35 insertions, 3 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index a30e823..a9656a3 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,6 +1,15 @@ 2018-05-15 Tamar Christina <tamar.christina@arm.com> PR binutils/21446 + * aarch64-dis.c (no_notes: New. + (parse_aarch64_dis_option): Support notes. + (aarch64_decode_insn, print_operands): Likewise. + (print_aarch64_disassembler_options): Document notes. + * aarch64-opc.c (aarch64_print_operand): Support notes. + +2018-05-15 Tamar Christina <tamar.christina@arm.com> + + PR binutils/21446 * aarch64-asm.h (aarch64_insert_operand, aarch64_##x): Return boolean and take error struct. * aarch64-asm.c (aarch64_ext_regno, aarch64_ins_reglane, diff --git a/opcodes/aarch64-dis.c b/opcodes/aarch64-dis.c index 5994b2b..ae53e49 100644 --- a/opcodes/aarch64-dis.c +++ b/opcodes/aarch64-dis.c @@ -46,7 +46,8 @@ static bfd_vma last_mapping_addr = 0; /* Other options */ static int no_aliases = 0; /* If set disassemble as most general inst. */ - +static int no_notes = 1; /* If set do not print disassemble notes in the + output as comments. */ static void set_default_aarch64_dis_options (struct disassemble_info *info ATTRIBUTE_UNUSED) @@ -69,6 +70,18 @@ parse_aarch64_dis_option (const char *option, unsigned int len ATTRIBUTE_UNUSED) return; } + if (CONST_STRNEQ (option, "no-notes")) + { + no_notes = 1; + return; + } + + if (CONST_STRNEQ (option, "notes")) + { + no_notes = 0; + return; + } + #ifdef DEBUG_AARCH64 if (CONST_STRNEQ (option, "debug_dump")) { @@ -2950,6 +2963,7 @@ print_operands (bfd_vma pc, const aarch64_opcode *opcode, const aarch64_opnd_info *opnds, struct disassemble_info *info) { int i, pcrel_p, num_printed; + char *notes = NULL; for (i = 0, num_printed = 0; i < AARCH64_MAX_OPND_NUM; ++i) { char str[128]; @@ -2964,7 +2978,7 @@ print_operands (bfd_vma pc, const aarch64_opcode *opcode, /* Generate the operand string in STR. */ aarch64_print_operand (str, sizeof (str), pc, opcode, opnds, i, &pcrel_p, - &info->target); + &info->target, ¬es); /* Print the delimiter (taking account of omitted operand(s)). */ if (str[0] != '\0') @@ -2977,6 +2991,9 @@ print_operands (bfd_vma pc, const aarch64_opcode *opcode, else (*info->fprintf_func) (info->stream, "%s", str); } + + if (notes && !no_notes) + (*info->fprintf_func) (info->stream, "\t; note: %s", notes); } /* Set NAME to a copy of INST's mnemonic with the "." suffix removed. */ @@ -3337,6 +3354,12 @@ with the -M switch (multiple options should be separated by commas):\n")); fprintf (stream, _("\n\ aliases Do print instruction aliases.\n")); + fprintf (stream, _("\n\ + no-notes Don't print instruction notes.\n")); + + fprintf (stream, _("\n\ + notes Do print instruction notes.\n")); + #ifdef DEBUG_AARCH64 fprintf (stream, _("\n\ debug_dump Temp switch for debug trace.\n")); diff --git a/opcodes/aarch64-opc.c b/opcodes/aarch64-opc.c index c688b7c7..9d7f941 100644 --- a/opcodes/aarch64-opc.c +++ b/opcodes/aarch64-opc.c @@ -3033,7 +3033,7 @@ void aarch64_print_operand (char *buf, size_t size, bfd_vma pc, const aarch64_opcode *opcode, const aarch64_opnd_info *opnds, int idx, int *pcrel_p, - bfd_vma *address) + bfd_vma *address, char** notes ATTRIBUTE_UNUSED) { unsigned int i, num_conds; const char *name = NULL; |