public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Set insn_type for branch instructions on aarch64
@ 2023-09-07 21:54 vladimir.mezentsev
  2023-09-08 11:09 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: vladimir.mezentsev @ 2023-09-07 21:54 UTC (permalink / raw)
  To: binutils; +Cc: Vladimir Mezentsev

From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>

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 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/opcodes/aarch64-dis.c b/opcodes/aarch64-dis.c
index e1183705537..03bcc372a56 100644
--- a/opcodes/aarch64-dis.c
+++ b/opcodes/aarch64-dis.c
@@ -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:
-- 
2.31.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Set insn_type for branch instructions on aarch64
  2023-09-07 21:54 [PATCH] Set insn_type for branch instructions on aarch64 vladimir.mezentsev
@ 2023-09-08 11:09 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2023-09-08 11:09 UTC (permalink / raw)
  To: vladimir.mezentsev, binutils

Hi Vladimir,

> 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.

Approved - please apply.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-08 11:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-07 21:54 [PATCH] Set insn_type for branch instructions on aarch64 vladimir.mezentsev
2023-09-08 11:09 ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).