Skip navigation.
Home
The QNX Community Portal

View topic - Forcing ntoarm-gdb to disassemble Thumb instruction

Forcing ntoarm-gdb to disassemble Thumb instruction

anything that doesn't fit to other groups.

Forcing ntoarm-gdb to disassemble Thumb instruction

Postby dimaggios » Tue May 20, 2014 8:56 am

I want ntoarm-gdb to disassemble instruction at a given address in Thumb mode, but can't get it to switch from ARM mode.

I found some solutions that worked for other versions of gdb (using pointer tagging and using word/halfword specifiers), but none of them seem to work in ntoarm-gdb:

Code: Select all
(gdb) x/10i 0x78e6d001
   0x78e6d001:  mov.w   r12, #0
   0x78e6d005:  str.w   r12, [r5, #-8]
   0x78e6d009:  movw    r3, #38900      ; 0x97f4
   0x78e6d00d:  movt    r3, #31123      ; 0x7993
   0x78e6d011:  str     r5, [r3, #0]
   0x78e6d013:  ldr.w   r2, [r5, #-40]
   0x78e6d017:  ldr.w   r1, [r2, #-24]
   0x78e6d01b:  mvn.w   r12, #4
   0x78e6d01f:  str.w   r12, [r5, #-20]
   0x78e6d023:  str.w   r1, [r5, #-24]


Code: Select all
(gdb) x/10hi 0x78e6d000
   0x78e6d000:  stceq   0, cr15, [r0], {79}     ; 0x4f
   0x78e6d004:  stcgt   8, cr15, [r8], {69}     ; 0x45
   0x78e6d008:  mvnsvc  pc, #-1879048188        ; 0x90000004
   0x78e6d00c:  orrsne  pc, r3, #208666624      ; 0xc700000
   0x78e6d010:                  ; <UNDEFINED> instruction: 0xf855601d
   0x78e6d014:                  ; <UNDEFINED> instruction: 0xf8522c28
   0x78e6d018:                  ; <UNDEFINED> instruction: 0xf06f1c18
   0x78e6d01c:                  ; <UNDEFINED> instruction: 0xf8450c04
   0x78e6d020:                  ; <UNDEFINED> instruction: 0xf845cc14
   0x78e6d024:                  ; <UNDEFINED> instruction: 0x46741c18

Still parsing instructions in 4-bytes size

Any workarounds?
It's important to note that gdb may figuure out the correct mode given symbols signifying a memory region as a .thumb_func, but unfortunately I have no symbols available.
dimaggios
New Member
 
Posts: 4
Joined: Thu May 08, 2014 7:43 am

Return to General Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron