PowerPC objdump -Mraw

Message ID 20190511004027.GY3195@bubble.grove.modra.org
State New
Headers show
Series
  • PowerPC objdump -Mraw
Related show

Commit Message

Alan Modra May 11, 2019, 12:40 a.m.
I think it makes sense to show all instruction fields for -Mraw.
Committed.

	* ppc-dis.c (print_insn_powerpc) Don't skip optional operands
	when -Mraw is in effect.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c
index d9ae42a3d0..e9e3b3621a 100644
--- a/opcodes/ppc-dis.c
+++ b/opcodes/ppc-dis.c
@@ -749,9 +749,11 @@  print_insn_powerpc (bfd_vma memaddr,
 
 	  operand = powerpc_operands + *opindex;
 
-	  /* If all of the optional operands have the value zero,
-	     then don't print any of them.  */
-	  if ((operand->flags & PPC_OPERAND_OPTIONAL) != 0)
+	  /* If all of the optional operands past this one have their
+	     default value, then don't print any of them.  Except in
+	     raw mode, print them all.  */
+	  if ((operand->flags & PPC_OPERAND_OPTIONAL) != 0
+	      && (dialect & PPC_OPCODE_RAW) == 0)
 	    {
 	      if (!skip_optional)
 		skip_optional = skip_optional_operands (opindex, insn, dialect);