Incorrect thumb disassembly/detection

Maximilian Schneider via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
Hello,

I am working on some code for a cortex-M33 and see that the gdb
disassembly does not match that of objdump, but only when a target is
connected.

$ arm-none-eabi-objdump -d bin/usb_cdc.elf | awk -v RS=
'/^[[:xdigit:]]+ <main>/'
00000cb8 <main>:
     cb8:	b500      	push	{lr}
     cba:	b085      	sub	sp, #20
     cbc:	ab03      	add	r3, sp, #12
[-snip-]

$ gdb-multiarch bin/usb_cdc.elf 
GNU gdb (Debian 8.2.1-2+b3) 8.2.1
[-snip-]
(gdb) disas main
Dump of assembler code for function main:
   0x00000cb8 <+0>:	push	{lr}
   0x00000cba <+2>:	sub	sp, #20
   0x00000cbc <+4>:	add	r3, sp, #12
[-snip-]
End of assembler dump.
(gdb) target remote localhost:2331
Remote debugging using localhost:2331
0x00000000 in __isr_vector ()
(gdb) disas main
Dump of assembler code for function main:
   0x00000cb8 <+0>:	bl	0xd6e4 <USB__IsHighSpeedCapable+12>
   0x00000cbc <+4>:	cbz	r0, 0xcc8 <main+16>
   0x00000cbe <+6>:	ldrb.w	r1, [sp, #6]
[-snip-]
End of assembler dump.

stepping instructions increments the program counter by 2 indicating
thumb mode. So i expect the disassembly also to be thumb.

What is causeing the disasembly to change to arm mode when a target is
used?

Best Regards!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.