This is the mail archive of the 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]

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


[May have been asked before - just point me in the general direction as
I couldn't find it with google or in the mailing lsit archive]

How can I force gdb to disassemble a memory region in thumb?

gdb 5.1 gets it right if there is symbol information, but just
disassembles to arm instructions when no symbol information is present
(apparently). Can I change this default to thumb (runtime), or is it
possible with a argument to the x/i command?

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

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]

but the halfword at 0xbe0 does (in this example) disassemble to 
ldr r7,[sp, #0xb5].

greets from Zürich
-- vbi

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