From: Max Filippov Date: Sat, 1 May 2021 09:22:19 +0000 (-0700) Subject: opcodes: xtensa: support branch visualization X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6aee2cb249daca249353d0dcceb0329a1662623c;p=binutils-gdb.git opcodes: xtensa: support branch visualization 2021-05-01 Max Filippov opcodes/ * xtensa-dis.c (print_insn_xtensa): Fill in info->insn_type and info->insn_info_valid. --- diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index f0840e34d9d..979b18cd0c1 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2021-05-01 Max Filippov + + * xtensa-dis.c (print_insn_xtensa): Fill in info->insn_type and + info->insn_info_valid. + 2021-04-26 Jan Beulich * i386-opc.tbl (lea): Add Optimize. diff --git a/opcodes/xtensa-dis.c b/opcodes/xtensa-dis.c index cfa058f96c7..c1cf4c82d60 100644 --- a/opcodes/xtensa-dis.c +++ b/opcodes/xtensa-dis.c @@ -412,6 +412,9 @@ print_insn_xtensa (bfd_vma memaddr, struct disassemble_info *info) if (nslots > 1) (*info->fprintf_func) (info->stream, "{ "); + info->insn_type = dis_nonbranch; + info->insn_info_valid = 1; + first_slot = 1; for (n = 0; n < nslots; n++) { @@ -425,6 +428,13 @@ print_insn_xtensa (bfd_vma memaddr, struct disassemble_info *info) (*info->fprintf_func) (info->stream, "%s", xtensa_opcode_name (isa, opc)); + if (xtensa_opcode_is_branch (isa, opc)) + info->insn_type = dis_condbranch; + else if (xtensa_opcode_is_jump (isa, opc)) + info->insn_type = dis_branch; + else if (xtensa_opcode_is_call (isa, opc)) + info->insn_type = dis_jsr; + /* Print the operands (if any). */ noperands = xtensa_opcode_num_operands (isa, opc); first = 1;