This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

patch for arm disassembler


Hi Nick

A longstanding quirk of the ARM disassembler has been that it sometimes shows 
offsets in decimal and sometimes in hex, without any indication to the user of 
which is which.  
(See http://sources.redhat.com/ml/bug-gdb/2001-07/msg00041.html)

The patch below makes this more consistent by always displaying offsets in 
decimal.  I think we can probably live with the risk of confusing any users 
who had gotten used to the old behaviour.

Is this okay to check in?  (The GAS testsuite needs adjusting, too, but the 
patch for that is pretty uninteresting so I haven't included it here.)

Thanks

p.

2001-07-13  Philip Blundell  <philb@gnu.org>

	* arm-dis.c (print_insn_arm): Use decimal for offsets in LDR/STR.

Index: arm-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/arm-dis.c,v
retrieving revision 1.22
diff -u -p -u -r1.22 arm-dis.c
--- arm-dis.c	2001/03/13 22:58:34	1.22
+++ arm-dis.c	2001/07/15 18:48:58
@@ -201,7 +201,7 @@ print_insn_arm (pc, info, given)
 				offset = - offset;
 			  
 			      /* pre-indexed */
-			      func (stream, ", #%x]", offset);
+			      func (stream, ", #%d]", offset);
 
 			      offset += pc + 8;
 
@@ -215,7 +215,7 @@ print_insn_arm (pc, info, given)
 			  else
 			    {
 			      /* Post indexed.  */
-			      func (stream, "], #%x", offset);
+			      func (stream, "], #%d", offset);
 
 			      offset = pc + 8;  /* ie ignore the offset.  */
 			    }
@@ -280,7 +280,7 @@ print_insn_arm (pc, info, given)
 			  if ((given & 0x00800000) == 0)
 			    offset = -offset;
 			  
-			  func (stream, "[pc, #%x]\t; ", offset);
+			  func (stream, "[pc, #%d]\t; ", offset);
 			  
 			  (*info->print_address_func)
 			    (offset + pc + 8, info);


PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]