opcodes: xtensa: support branch visualization
authorMax Filippov <jcmvbkbc@gmail.com>
Sat, 1 May 2021 09:22:19 +0000 (02:22 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Sat, 1 May 2021 09:47:30 +0000 (02:47 -0700)
2021-05-01  Max Filippov  <jcmvbkbc@gmail.com>
opcodes/
* xtensa-dis.c (print_insn_xtensa): Fill in info->insn_type and
info->insn_info_valid.

opcodes/ChangeLog
opcodes/xtensa-dis.c

index f0840e34d9dca8d5b16010647670057611d7aa37..979b18cd0c1b7ea2ae081ca98b7c0f72b6dec260 100644 (file)
@@ -1,3 +1,8 @@
+2021-05-01  Max Filippov  <jcmvbkbc@gmail.com>
+
+       * xtensa-dis.c (print_insn_xtensa): Fill in info->insn_type and
+       info->insn_info_valid.
+
 2021-04-26  Jan Beulich  <jbeulich@suse.com>
 
        * i386-opc.tbl (lea): Add Optimize.
index cfa058f96c711dbbe65bbc315512c96bf75391c1..c1cf4c82d608328eebf27e958d8767e5d6d94040 100644 (file)
@@ -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;