From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17587 invoked by alias); 21 Apr 2003 22:02:59 -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 17573 invoked from network); 21 Apr 2003 22:02:58 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 21 Apr 2003 22:02:58 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 197jNW-0003Cy-00; Mon, 21 Apr 2003 17:03:10 -0500 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 197jNG-0001pM-00; Mon, 21 Apr 2003 18:02:54 -0400 Date: Mon, 21 Apr 2003 22:02:00 -0000 From: Daniel Jacobowitz To: Kevin Buettner Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] dwarf2loc.c: Add missing DWARF2_REG_TO_REGNUM call Message-ID: <20030421220254.GA6912@nevyn.them.org> Mail-Followup-To: Kevin Buettner , gdb-patches@sources.redhat.com References: <1030421214653.ZM18664@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1030421214653.ZM18664@localhost.localdomain> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-04/txt/msg00382.txt.bz2 On Mon, Apr 21, 2003 at 02:46:53PM -0700, Kevin Buettner wrote: > I'm testing on a target for which DWARF2_REG_TO_REGNUM is not the > identity function. I found that gdb was fetching the wrong register > in dwarf2loc.c. The patch below fixes this problem. > > Okay? > > (This is almost obvious, but there are several choices for where this > call might be placed...) Hmm... this isn't my area to approve, but I believe this the right place for the call. dwarf_expr_read_reg already assumes that the regno on the stack is a DWARF-2 register number. > > * dwarf2loc.c (dwarf2_evaluate_loc_desc): Invoke DWARF2_REG_TO_REGNUM > on the DWARF2 register number prior to fetching a register. > > Index: dwarf2loc.c > =================================================================== > RCS file: /cvs/cvsfiles/devo/gdb/dwarf2loc.c,v > retrieving revision 2.2 > diff -u -p -r2.2 dwarf2loc.c > --- dwarf2loc.c 2003/04/16 21:18:45 2.2 > +++ dwarf2loc.c 2003/04/21 21:32:40 > @@ -223,7 +223,8 @@ dwarf2_evaluate_loc_desc (struct symbol > result = dwarf_expr_fetch (ctx, 0); > > if (ctx->in_reg) > - retval = value_from_register (SYMBOL_TYPE (var), result, frame); > + retval = value_from_register (SYMBOL_TYPE (var), > + DWARF2_REG_TO_REGNUM (result), frame); > else > { > retval = allocate_value (SYMBOL_TYPE (var)); > -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer