From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10624 invoked by alias); 22 Apr 2003 14:15:54 -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 10616 invoked from network); 22 Apr 2003 14:15:54 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 22 Apr 2003 14:15:54 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h3MEFrD22566 for ; Tue, 22 Apr 2003 10:15:53 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h3MEFrq24547 for ; Tue, 22 Apr 2003 10:15:53 -0400 Received: from localhost.redhat.com (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h3MEFqc09498; Tue, 22 Apr 2003 10:15:52 -0400 Received: by localhost.redhat.com (Postfix, from userid 469) id 382D92C439; Tue, 22 Apr 2003 10:20:27 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16037.20395.87464.994345@localhost.redhat.com> Date: Tue, 22 Apr 2003 14:15:00 -0000 To: Daniel Jacobowitz Cc: Kevin Buettner , gdb-patches@sources.redhat.com Subject: Re: [RFA] dwarf2loc.c: Add missing DWARF2_REG_TO_REGNUM call In-Reply-To: <20030421220254.GA6912@nevyn.them.org> References: <1030421214653.ZM18664@localhost.localdomain> <20030421220254.GA6912@nevyn.them.org> X-SW-Source: 2003-04/txt/msg00392.txt.bz2 Daniel Jacobowitz writes: > 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. > OK from my side, except, could you introduce a new variable 'regnum'? elena > > > > * 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