From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1609 invoked by alias); 3 Mar 2004 16:49:34 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 1596 invoked from network); 3 Mar 2004 16:49:33 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 3 Mar 2004 16:49:33 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1AyZYr-0004ki-F8; Wed, 03 Mar 2004 11:49:33 -0500 Date: Wed, 03 Mar 2004 16:49:00 -0000 From: Daniel Jacobowitz To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: [rfc] trad-frame change Message-ID: <20040303164933.GB18032@nevyn.them.org> Mail-Followup-To: Andrew Cagney , gdb-patches@sources.redhat.com References: <40460B28.3000504@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40460B28.3000504@gnu.org> User-Agent: Mutt/1.5.1i X-SW-Source: 2004-03.o/txt/msg00047.txt On Wed, Mar 03, 2004 at 11:43:20AM -0500, Andrew Cagney wrote: > Think of this as a pseudo patch. > > I'm looking to extend the trad-frame code so that it includes the interface: > > trad_frame_append (gdbarch, frame_type, frame_sniffer, frame_cache); > > This would do all the housekeeping necessary to create a FRAME_TYPE > unwinder implemented with FRAME_SNIFFER and FRAME_CACHE functions. The > second function would have the interface: > > struct trad_frame_cache > { > struct frame_id this_id; > CORE_ADDR this_base; > struct trad_frame *saved_regs; > }; > > void frame_cache (struct frame_info *next_frame, struct > trad_frame_cache *this_cache); > > and would be called _once_ to populate the entire trad-frame cache. > After that frame ID and register requests would be handled directly. > > My rationale is simple. Having just churned out unwinders for two > architectures I'm seeing a pattern that suggests this would make life > easier: Sounds pretty nice to me. For what it's worth, I'm testing a sigtramp unwinder on MIPS/Linux that could almost but not quite use this: +struct mips_prologue_cache +{ + /* The stack pointer at the time this frame was created; i.e. the + caller's stack pointer when this function was called. It is used + to identify this frame. */ + CORE_ADDR prev_sp; + + CORE_ADDR tramp_start; + + int kind; + + /* Saved register offsets. */ + struct trad_frame_saved_reg *saved_regs; +}; (so that the frame ID is constant for both instructions of the trampoline). -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1609 invoked by alias); 3 Mar 2004 16:49:34 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 1596 invoked from network); 3 Mar 2004 16:49:33 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 3 Mar 2004 16:49:33 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1AyZYr-0004ki-F8; Wed, 03 Mar 2004 11:49:33 -0500 Date: Fri, 19 Mar 2004 00:09:00 -0000 From: Daniel Jacobowitz To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: [rfc] trad-frame change Message-ID: <20040303164933.GB18032@nevyn.them.org> Mail-Followup-To: Andrew Cagney , gdb-patches@sources.redhat.com References: <40460B28.3000504@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40460B28.3000504@gnu.org> User-Agent: Mutt/1.5.1i X-SW-Source: 2004-03/txt/msg00047.txt.bz2 Message-ID: <20040319000900.9rch1PLVvcQSZydg9Y1EFzWRQw5vi8MHsqSR8RQHKlY@z> On Wed, Mar 03, 2004 at 11:43:20AM -0500, Andrew Cagney wrote: > Think of this as a pseudo patch. > > I'm looking to extend the trad-frame code so that it includes the interface: > > trad_frame_append (gdbarch, frame_type, frame_sniffer, frame_cache); > > This would do all the housekeeping necessary to create a FRAME_TYPE > unwinder implemented with FRAME_SNIFFER and FRAME_CACHE functions. The > second function would have the interface: > > struct trad_frame_cache > { > struct frame_id this_id; > CORE_ADDR this_base; > struct trad_frame *saved_regs; > }; > > void frame_cache (struct frame_info *next_frame, struct > trad_frame_cache *this_cache); > > and would be called _once_ to populate the entire trad-frame cache. > After that frame ID and register requests would be handled directly. > > My rationale is simple. Having just churned out unwinders for two > architectures I'm seeing a pattern that suggests this would make life > easier: Sounds pretty nice to me. For what it's worth, I'm testing a sigtramp unwinder on MIPS/Linux that could almost but not quite use this: +struct mips_prologue_cache +{ + /* The stack pointer at the time this frame was created; i.e. the + caller's stack pointer when this function was called. It is used + to identify this frame. */ + CORE_ADDR prev_sp; + + CORE_ADDR tramp_start; + + int kind; + + /* Saved register offsets. */ + struct trad_frame_saved_reg *saved_regs; +}; (so that the frame ID is constant for both instructions of the trampoline). -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer