From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14056 invoked by alias); 22 Nov 2005 09:36:55 -0000 Received: (qmail 14047 invoked by uid 22791); 22 Nov 2005 09:36:52 -0000 X-Spam-Check-By: sourceware.org Received: from fra-del-01.spheriq.net (HELO fra-del-01.spheriq.net) (195.46.51.97) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 22 Nov 2005 09:36:51 +0000 Received: from fra-out-02.spheriq.net (fra-out-02.spheriq.net [195.46.51.130]) by fra-del-01.spheriq.net with ESMTP id jAM9akg4024619 for ; Tue, 22 Nov 2005 09:36:46 GMT Received: from fra-cus-02.spheriq.net (fra-cus-02.spheriq.net [195.46.51.38]) by fra-out-02.spheriq.net with ESMTP id jAM9aj7p032402 for ; Tue, 22 Nov 2005 09:36:45 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by fra-cus-02.spheriq.net with ESMTP id jAM9aiHj030105 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Tue, 22 Nov 2005 09:36:45 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1A409DAEC for ; Tue, 22 Nov 2005 09:32:40 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 60012) id 1AA4247292; Tue, 22 Nov 2005 09:35:41 +0000 (GMT) Received: from zeta.dmz-eu.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7ED29759B2 for ; Tue, 22 Nov 2005 09:35:40 +0000 (UTC) Received: from mail2.gnb.st.com (mail2.gnb.st.com [164.129.119.59]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CFD1C472F1 for ; Tue, 22 Nov 2005 09:35:38 +0000 (GMT) Received: from st.com (gnx2364.gnb.st.com [164.129.122.218]) by mail2.gnb.st.com (MOS 3.5.8-GR) with ESMTP id CFU08183 (AUTH lyon); Tue, 22 Nov 2005 10:32:33 +0100 (CET) Message-ID: <4382E5B0.3030702@st.com> Date: Tue, 22 Nov 2005 17:07:00 -0000 From: Christophe LYON User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.3) Gecko/20040924 MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [RFC] add offset support to DWARF2_FRAME_REG_CFA Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-O-Spoofed: Not Scanned X-O-General-Status: No X-O-Spam1-Status: Not Scanned X-O-Spam2-Status: Not Scanned X-O-URL-Status: Not Scanned X-O-Virus1-Status: No X-O-Virus2-Status: Not Scanned X-O-Virus3-Status: No X-O-Virus4-Status: No X-O-Virus5-Status: Not Scanned X-O-Image-Status: Not Scanned X-O-Attach-Status: Not Scanned X-SpheriQ-Ver: 4.1.07 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-11/txt/msg00409.txt.bz2 Hi all, Following a discussion we had back in july, I would like to submit the following small patch. It enables to describe that SP = CFA + offset, rather than only SP = CFA. It can be used in conjonction with a customized xxx_dwarf2_frame_init_reg(). Regards, Christophe. 2005-11-22 Christophe Lyon * dwarf2-frame.c: (dwarf2_frame_default_init_reg): Ensure default offset between SP and CFA is 0. (dwarf2_frame_prev_register): add offset to CFA in order to compute SP Index: dwarf2-frame.c =================================================================== --- dwarf2-frame.c (revision 96) +++ dwarf2-frame.c (working copy) @@ -539,7 +542,10 @@ if (regnum == PC_REGNUM) reg->how = DWARF2_FRAME_REG_RA; else if (regnum == SP_REGNUM) - reg->how = DWARF2_FRAME_REG_CFA; + { + reg->how = DWARF2_FRAME_REG_CFA; + reg->loc.offset = 0; + } } /* Return a default for the architecture-specific operations. */ @@ -914,7 +920,8 @@ if (valuep) { /* Store the value. */ - store_typed_address (valuep, builtin_type_void_data_ptr, cache->cfa); + store_typed_address (valuep, builtin_type_void_data_ptr, + cache->cfa + cache->reg[regnum].loc.offset); } break;