From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from h2828900.stratoserver.net (unknown [IPv6:2a01:238:4297:d900:4603:3bf9:5939:b0a9]) by sourceware.org (Postfix) with ESMTP id E79713858C27 for ; Sat, 11 Sep 2021 10:41:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E79713858C27 Received: from [192.168.0.251] (ip5f5accb0.dynamic.kabel-deutschland.de [95.90.204.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: max@schneidersoft.net) by h2828900.stratoserver.net (Postfix) with ESMTPSA id 74A9C34047D for ; Sat, 11 Sep 2021 12:41:26 +0200 (CEST) Message-ID: Subject: Incorrect thumb disassembly/detection From: Maximilian Schneider To: gdb@sourceware.org Date: Sat, 11 Sep 2021 11:41:21 +0100 Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, SPF_FAIL, SPF_HELO_NONE, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Sep 2021 10:41:29 -0000 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:]]+
/' 00000cb8
: 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 0x00000cbc <+4>: cbz r0, 0xcc8 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!