From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id PkGgOSTQJmn7sTEAWB0awg (envelope-from ) for ; Wed, 26 Nov 2025 05:02:12 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=IDwdAE/+; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id DD9831E08D; Wed, 26 Nov 2025 05:02:12 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 11F121E08D for ; Wed, 26 Nov 2025 05:02:12 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2EEA23858C51 for ; Wed, 26 Nov 2025 10:02:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2EEA23858C51 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1764151331; bh=lCQgkbYoZ0W3NyaR5Y9cX8v8WdF8BgzU8CFOEYqn0Ek=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=IDwdAE/+W5gvqsddjTQupOqgym2BP/YrEV3cCVadmSYxkRlK7vEfEhzJ0j/AhWnEt Rd1yvXSjP56rccjAa14aueMAGSJN9z9GBzRr3FRU8gVwO7Erjl9ur6XAYn6/jOTuwK 2JIQIEnC9gy5oefGYouLGO3Zcnc8JN6T9NY8jxXs= Received: from clesse.com (clesse.com [62.73.6.239]) by sourceware.org (Postfix) with ESMTPS id 2632B3858C31 for ; Wed, 26 Nov 2025 10:01:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2632B3858C31 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2632B3858C31 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1764151280; cv=none; b=A05Hwz4xhPOV+e4GQBlk/ieZB/yMfSTPYNoIjjdOm1+mNwYVp/u5fR2fZW5TXhwnk+u8riWwODEhxM/nmVeQLVdFVCWw0e24JKuQoH8ailUilJlgcQH4eIIsd0RiPIvTeldcG7j3Amp0jfWBy/9CIo2HKBtkz1JheRyowVXo0OE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1764151280; c=relaxed/simple; bh=lc1b5G1eTLb3gNdnADnECzbCs+AA04DUeeB5LGYP2oQ=; h=DKIM-Signature:MIME-Version:Date:From:To:Subject:Message-ID; b=oeY8AOKAYFoCZtxcD+AGUGevOjeUd+R+5ESjWpCKW/oNMAmRBUhvPCxmlk0nrgDFpFHBxMIureIDB2ehQw+m3zwXYpq2m4R3zySbPyCdMey3QX3hCutdf09AKtuyeCd3j3LLRxgsnbOSRu6eE0DtVNWPA1qBVX+rq3rqn8Q0HNo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2632B3858C31 Received: from webmail.clesse.com (localhost.localdomain [IPv6:::1]) by console5.axinet.fr (Postfix) with ESMTPSA id E2A5545DF48 for ; Wed, 26 Nov 2025 11:00:50 +0100 (CET) Received-SPF: pass (LEIA: connection is authenticated) MIME-Version: 1.0 Date: Wed, 26 Nov 2025 11:00:50 +0100 To: gdb@sourceware.org Subject: Creating and using dwarf information for ARMv7-A exception handlers In-Reply-To: <51ebaf670472865c9abb31854e16c795@clesse.com> References: <1916c229fb1f148902bf15a1b60dedbe@clesse.com> <51ebaf670472865c9abb31854e16c795@clesse.com> User-Agent: Roundcube Webmail/1.4.15 Message-ID: <6af4b8e63d0f1e9ec75d5ca4452874a8@clesse.com> X-Sender: jh@clesse.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-PPP-Message-ID: <176415125152.15926.17353322881370316198@LEIA.axinet.fr> X-PPP-Vhost: clesse.com X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: jh--- via Gdb Reply-To: jh@clesse.com Errors-To: gdb-bounces~public-inbox=simark.ca@sourceware.org Sender: "Gdb" Hi, I am working on an embedded target with a Cortex-A9 CPU. There is a debug tool based on Eclipse and gdb 10.2. I would like (if it is possible) to have a complete stack trace when my code is in the SVC handler. I can place a breakpoint at the beginning of my SVC handler, and LR_SVC has the right value, but the function call stack is not good (later when I change the CPSR mode from SVC to SYS, the call stack gets better, but does not go back to the calling USR mode - but that's expected, since I change SP and haven't written the needed cfi code yet. But going back to the USR call stack is my ideal objective). I tried to set the stack base (CFA if I understood properly) to R13_SVC (register 164 according to aadwarf32.pdf). I don't know if it works, but at least, I get something when I dwarfdump asm_vector.o. I also tried to set the return address to R14_SVC (register 165 according to aadwarf32.pdf), this produces the "return_address_register 165" (instead of 14 which is LR as expected) output of dwarfdump. But the call stack does not change in gdb (or more precisely in Eclipse). The code is compile with arm-none-eabi-gcc 11.2.0 Here is what I tried: SVCHandler: // CPSR mode is SVC .type SVCHandler,%function .cfi_sections .debug_frame .cfi_startproc .cfi_def_cfa_register 164 //sp_svc .cfi_return_column 165 //lr_svc PUSH {R0-R3} // Do some stuff, changing CPSR mode to SYS // Change CPSR mode back to SVC POP {R0-R3} SUBS PC, LR, #0 .cfi_endproc Here is the output of dwarfdump: fde: < 0><0x0000035c:0x00000428><> 0x0000035c: cie: < 0> version 1 cie section offset 0 0x00000000 augmentation code_alignment_factor 2 data_alignment_factor -4 return_address_register 165 bytes of initial instructions 7 cie length 16 initial instructions 0 DW_CFA_def_cfa r13 0 3 DW_CFA_def_cfa_register r164 6 DW_CFA_nop What am I doing wrong? Is there a way to dump the dwarf state in gdb? To try and determine what it understands of my code and how it is primed when the breakpoint is triggered. Is the register number wrong? Is it something on the gdb side? Best regards, JH.