From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8047 invoked by alias); 12 Apr 2006 19:20:44 -0000 Received: (qmail 8022 invoked by uid 22791); 12 Apr 2006 19:20:42 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 12 Apr 2006 19:20:40 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k3CJKbpX000707; Wed, 12 Apr 2006 15:20:37 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.11.6) with ESMTP id k3CJKasC022252; Wed, 12 Apr 2006 15:20:36 -0400 Received: from [172.16.24.50] (bluegiant.sfbay.redhat.com [172.16.24.50]) by potter.sfbay.redhat.com (8.12.8/8.12.8) with ESMTP id k3CJKYTq022945; Wed, 12 Apr 2006 15:20:35 -0400 Message-ID: <443D5302.3020708@redhat.com> Date: Wed, 12 Apr 2006 19:20:00 -0000 From: Michael Snyder User-Agent: Mozilla Thunderbird 1.0.7-1.4.1 (X11/20050929) MIME-Version: 1.0 To: Jim Blandy CC: gdb-patches@sourceware.org, Daniel Jacobowitz Subject: Re: [RFA/RFC] dwarf2-frame read_reg References: <443C7529.7020206@redhat.com> <8f2776cb0604112142i32dcdf0dic8f44f2989311786@mail.gmail.com> In-Reply-To: <8f2776cb0604112142i32dcdf0dic8f44f2989311786@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00155.txt.bz2 Jim Blandy wrote: > On 4/11/06, Michael Snyder wrote: > >>I want you guys to vett this change. I was getting wrong results >>on a target where sizeof (SP) != sizeof (void *). The local func >>read_reg was calling extract_unsigned_integer with the wrong size. > > > Well, extract_typed_address requires the type of the register to be > some sort of pointer. read_reg is given as a callback to the Dwarf > expression evaluator in dwarf2expr.c, so it could be handed any > register at all. > > How about unpack_long (buf, register_type (gdbarch, regnum))? > Definitely regression-test this on several platforms... > Hmmm... extract_typed_address calls POINTER_TO_ADDRESS, which seems more likely to "do the right thing". How about this? if (TYPE_CODE (register_type (gdbarch, regnum)) == TYPE_CODE_PTR) return extract_typed_address (buf, register_type (gdbarch, regnum)); else return extract_typed_address (buf, builtin_type_void_data_ptr); (I am assuming that a register_type is unlikely to be TYPE_CODE_REF)