From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12645 invoked by alias); 20 Apr 2006 19:06:48 -0000 Received: (qmail 12631 invoked by uid 22791); 20 Apr 2006 19:06:45 -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; Thu, 20 Apr 2006 19:06: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 k3KJ6YUl010637; Thu, 20 Apr 2006 15:06:34 -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 k3KJ6RXp011557; Thu, 20 Apr 2006 15:06:29 -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 k3KJ6LTq015671; Thu, 20 Apr 2006 15:06:22 -0400 Message-ID: <4447DBAB.4030202@redhat.com> Date: Thu, 20 Apr 2006 19:06:00 -0000 From: Michael Snyder User-Agent: Mozilla Thunderbird 1.0.7-1.4.1 (X11/20050929) MIME-Version: 1.0 To: Daniel Jacobowitz CC: Mark Kettenis , jimb@red-bean.com, gdb-patches@sourceware.org Subject: Re: [RFA/RFC] dwarf2-frame read_reg References: <443C7529.7020206@redhat.com> <8f2776cb0604112142i32dcdf0dic8f44f2989311786@mail.gmail.com> <200604121817.k3CIH7nA021495@elgar.sibelius.xs4all.nl> <20060420172112.GK11710@nevyn.them.org> In-Reply-To: <20060420172112.GK11710@nevyn.them.org> 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/msg00289.txt.bz2 Daniel Jacobowitz wrote: > On Wed, Apr 12, 2006 at 08:17:07PM +0200, Mark Kettenis wrote: > >>>Date: Tue, 11 Apr 2006 21:42:01 -0700 >>>From: "Jim Blandy" >>> >>>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... >> >>This is likely to be wrong for platforms where addresses are signed. > > > It shouldn't be. > > unpack_long (struct type *type, const gdb_byte *valaddr) > { > ... > case TYPE_CODE_PTR: > case TYPE_CODE_REF: > /* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure > whether we want this to be true eventually. */ > return extract_typed_address (valaddr, type); > > which calls POINTER_TO_ADDRESS. And that will be the signed unpack for > MIPS, and the unsigned unpack for other targets. > > So I think unpack_long is a good choice. > > (I didn't realize that before. I think I have another pending patch > that this would be useful for - maybe the psaddr_t one?) May I release the patch into your care? I don't really think I understand the problem domain well enough (wouldn't be able to test it well), and I've made my own need for it go away by other means.