Set insn_type for branch instructions on aarch64
authorVladimir Mezentsev <vladimir.mezentsev@oracle.com>
Thu, 7 Sep 2023 21:50:15 +0000 (14:50 -0700)
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>
Fri, 8 Sep 2023 18:55:36 +0000 (11:55 -0700)
gprofng uses insn_type in print_address_func().
But insn_type is always zero on aarch64.

opcodes/ChangeLog:
2023-09-07  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

* opcodes/aarch64-dis.c (print_insn_aarch64_word): Set insn_type for
branch instructions.

opcodes/aarch64-dis.c

index e1183705537bc9b38675bf69542805958b18959d..03bcc372a56355edf3dccf8613277b2072bbc14f 100644 (file)
@@ -3846,6 +3846,12 @@ print_insn_aarch64_word (bfd_vma pc,
       break;
     case ERR_OK:
       user_friendly_fixup (&inst);
+      if (inst.opcode->iclass == condbranch
+         || inst.opcode->iclass == testbranch
+         || inst.opcode->iclass == compbranch)
+        info->insn_type = dis_condbranch;
+      else if (inst.opcode->iclass == branch_imm)
+        info->insn_type = dis_jsr;
       print_aarch64_insn (pc, &inst, word, info, errors);
       break;
     default: