From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 375 invoked by alias); 11 Jul 2005 15:47:29 -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 344 invoked by uid 22791); 11 Jul 2005 15:47:25 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 11 Jul 2005 15:47:25 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1Ds0V9-00087c-P6; Mon, 11 Jul 2005 11:47:23 -0400 Date: Mon, 11 Jul 2005 15:47:00 -0000 From: Daniel Jacobowitz To: Christophe LYON Cc: gdb@sources.redhat.com Subject: Re: dwarf2 frame unwinder assumptions on SP Message-ID: <20050711154723.GA30937@nevyn.them.org> Mail-Followup-To: Christophe LYON , gdb@sources.redhat.com References: <42D285AB.9E36C062@st.com> <20050711145053.GA29229@nevyn.them.org> <42D290FF.F665B4A1@st.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42D290FF.F665B4A1@st.com> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-07/txt/msg00117.txt.bz2 On Mon, Jul 11, 2005 at 05:32:15PM +0200, Christophe LYON wrote: > > > > Currently, in my x-tdep.c I have: > > > set_gdbarch_unwind_pc(gdbarch, x_unwind_pc); > > > frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer); > > > > 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. -- Daniel Jacobowitz CodeSourcery, LLC