From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8460 invoked by alias); 21 Apr 2003 21:47:00 -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 8451 invoked from network); 21 Apr 2003 21:46:59 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 21 Apr 2003 21:46:59 -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 h3LLkxD27119 for ; Mon, 21 Apr 2003 17:46:59 -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 h3LLkxq12022 for ; Mon, 21 Apr 2003 17:46:59 -0400 Received: from localhost.localdomain (vpn50-16.rdu.redhat.com [172.16.50.16]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h3LLkxc15423 for ; Mon, 21 Apr 2003 17:46:59 -0400 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id h3LLkrQ18665 for gdb-patches@sources.redhat.com; Mon, 21 Apr 2003 14:46:53 -0700 Date: Mon, 21 Apr 2003 21:47:00 -0000 From: Kevin Buettner Message-Id: <1030421214653.ZM18664@localhost.localdomain> To: gdb-patches@sources.redhat.com Subject: [RFA] dwarf2loc.c: Add missing DWARF2_REG_TO_REGNUM call MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-04/txt/msg00380.txt.bz2 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...) * 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));