From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4274 invoked by alias); 8 Jun 2003 16:58:09 -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 4264 invoked from network); 8 Jun 2003 16:58:08 -0000 Received: from unknown (HELO crack.them.org) (146.82.138.56) by sources.redhat.com with SMTP; 8 Jun 2003 16:58:08 -0000 Received: from dsl093-172-017.pit1.dsl.speakeasy.net ([66.93.172.17] helo=nevyn.them.org ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 19P3VK-0006UV-00; Sun, 08 Jun 2003 11:58:51 -0500 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 19P3UW-00046b-00; Sun, 08 Jun 2003 12:58:00 -0400 Date: Sun, 08 Jun 2003 16:58:00 -0000 From: Daniel Jacobowitz To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: [commit] Split d10v-tdep.c into trad-frame.[hc] Message-ID: <20030608165800.GA15675@nevyn.them.org> Mail-Followup-To: Andrew Cagney , gdb-patches@sources.redhat.com References: <3EE36123.3020508@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3EE36123.3020508@redhat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-06/txt/msg00275.txt.bz2 On Sun, Jun 08, 2003 at 12:15:31PM -0400, Andrew Cagney wrote: > Hello, > > This moves a chunk of d10v's frame unwind code into trad-frame.[hc]. It > creates a simple framework that traditional unwinders can use - a > successor to get_frame_saved_regs(). > > Handling the problem of the previous frame's PC being in this frame's LR > is remarkably simple - just copy the saved location of LR into PC! I like it. Just one complaint: > +struct trad_frame > +{ > + /* If non-zero (and regnum >= 0), the stack address at which the > + register is saved. By default, it is assumed that the register > + was not saved (addr == 0). Remember, a LONGEST can always fit a > + CORE_ADDR. */ > + LONGEST addr; > + /* else, if regnum >=0 (and addr == 0), the REGNUM that contains > + this registers value. By default, it is assumed that the > + registers are not moved (the register's value is still in that > + register and regnum == the index). */ > + int regnum; > + /* else, if regnum < 0, ADDR is the registers value. */ > +}; Gyuh? I looked at this for a couple of minutes and couldn't make heads or tails of it until I went to look at trad-frame.c: this structure isn't a frame at all, it's a single saved register. Could you rename it, and update the comments? I'm also not sure I understand all the combinations: regnum < 0, addr is the register value regnum >= 0 and addr 0, regnum holds the new register number (in the next frame?) regnum >= 0 and addr non-zero, addr is the save address - but what's regnum mean? Nothing? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer