From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8649 invoked by alias); 11 Jul 2005 15:58:27 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 8590 invoked by uid 22791); 11 Jul 2005 15:58:22 -0000 Received: from lon-del-01.spheriq.net (HELO lon-del-01.spheriq.net) (195.46.50.97) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 11 Jul 2005 15:58:22 +0000 Received: from lon-out-02.spheriq.net ([195.46.50.130]) by lon-del-01.spheriq.net with ESMTP id j6BFwJSQ002863 for ; Mon, 11 Jul 2005 15:58:19 GMT Received: from lon-cus-01.spheriq.net (lon-cus-01.spheriq.net [195.46.50.37]) by lon-out-02.spheriq.net with ESMTP id j6BFwIU7027079 for ; Mon, 11 Jul 2005 15:58:19 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by lon-cus-01.spheriq.net with ESMTP id j6BFwIxB002878 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Mon, 11 Jul 2005 15:58:18 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 C4A18DA43; Mon, 11 Jul 2005 15:58:17 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 60012) id 2E22147570; Mon, 11 Jul 2005 16:00:17 +0000 (GMT) Received: from zeta.dmz-eu.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C9A2A75994; Mon, 11 Jul 2005 16:00:16 +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 2E16F47572; Mon, 11 Jul 2005 16:00:16 +0000 (GMT) Received: from st.com (pcx0003.gnb.st.com [164.129.118.67]) by mail2.gnb.st.com (MOS 3.4.4-GR) with ESMTP id BNP03374 (AUTH lyon); Mon, 11 Jul 2005 17:58:14 +0200 (CEST) Message-ID: <42D29716.CCF93A0C@st.com> Date: Mon, 11 Jul 2005 15:58:00 -0000 From: Christophe LYON MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb@sources.redhat.com Subject: Re: dwarf2 frame unwinder assumptions on SP References: <42D285AB.9E36C062@st.com> <20050711145053.GA29229@nevyn.them.org> <42D290FF.F665B4A1@st.com> <20050711154723.GA30937@nevyn.them.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: 2.2.2 X-SW-Source: 2005-07/txt/msg00119.txt.bz2 > > > > Currently, in my x-tdep.c I have: > > > > set_gdbarch_unwind_pc(gdbarch, x_unwind_pc); > > > > frame_unwind_append_sniffer (gdbarch, > > > > > > It sounds like you need to set a "frame base" sniffer also, other than > > > the dwarf one. The dwarf2 frame unwinder does not set anything related > > > to the "frame base" used by symbolic debug information; it only unwinds > > > the stack pointer as best it can. > > > > > > Does "print $sp" work correctly when unwinding? > > > > > > > At frame #0, it's OK, at frame #1 it is not (it displays CFA). > > Then you've got an unwinding problem. Your unwind information is not > providing adequate information to recreate the value of $sp, so > adjusting the frame base isn't going to help after all. > > You probably want to provide an init_reg method which does something > clever with SP_REGNUM. You may get the easiest results by adjusting > DWARF2_FRAME_REG_CFA to support an offset, i.e., set $sp to the value > of the CFA plus some fixed offset. > I don't see what to do in init_reg without adding a new value to the dwarf2_frame_reg_rule enum. Do you mean changing the semantics of DWARF2_FRAME_REG_CFA and provide a frame_prev_register() method to interpret it accordingly? If the latter, it also means I have to write a specific frame_sniffer() to return the frame_unwind struct pointing to my frame_prev_register() method, right? Then, it sounds like my frame_sniffer() should replace dwarf2_frame_sniffer() but use the same code, as I only want to replace frame_prev_register(). Am I right? Thanks, Christophe.