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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [arm] force gdb into disassembling in thumb (arm) mode


> The sensible way (imho) would be to interpret the (h)alfword/(w)ord
> format letters, so that x/ih and x/iw would force to interpret 16/32 bit
> instructions.

Yes, something like this would be nice.

> x/i on an odd address currently does switch to thumb mode - but it seems
> to interpret the instructions at the odd address (it doesn't strip the
> lsb when loading the data):
> 
> (gdb) x/20i 0xbe1
> 0xbe1:	ldrsh	r5, [r6, r6]
> 0xbe3:	strb	r6, [r0, r5]
> 0xbe5:	ldr	r4, [pc, #280]	(0xd00)
> 0xbe7:	add	sp, #280
> 0xbe9:	undefined instruction 0x47b4
> 0xbeb:	strh	r6, [r0, #2]

Hmm, a quick test on the CVS sources shows that using an odd address will 
DTRT (ie force thumb mode but then round the address down); I can't see 
anything from the commit log that might have changed.  The key is this 
line of code:

gdb/arm-tdep.c/gdb_print_insn_arm()
      memaddr = UNMAKE_THUMB_ADDR (memaddr);

Which strips off the thumb bit before actually loading the half-word.

R.


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