[COMMITTED] opcodes: xtensa: support branch visualization

Message ID 20210501094855.19423-1-jcmvbkbc@gmail.com
State New
Headers show
Series
  • [COMMITTED] opcodes: xtensa: support branch visualization
Related show

Commit Message

Nick Clifton via Binutils May 1, 2021, 9:48 a.m.
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/xtensa-dis.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

-- 
2.20.1

Patch

diff --git a/opcodes/xtensa-dis.c b/opcodes/xtensa-dis.c
index cfa058f96c71..c1cf4c82d608 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;