From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12504 invoked by alias); 23 Apr 2007 21:06:57 -0000 Received: (qmail 12496 invoked by uid 22791); 23 Apr 2007 21:06:56 -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; Mon, 23 Apr 2007 22:06:53 +0100 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l3NL6qD7030433 for ; Mon, 23 Apr 2007 17:06:52 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l3NL6kEE025898 for ; Mon, 23 Apr 2007 17:06:46 -0400 Received: from ironwood.lan (vpn-15-49.rdu.redhat.com [10.11.15.49]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l3NL6hCh020998 for ; Mon, 23 Apr 2007 17:06:44 -0400 Date: Mon, 23 Apr 2007 21:51:00 -0000 From: Kevin Buettner To: gdb-patches@sources.redhat.com Subject: Re: [RFC] dwarf2_read_address(): sign extend as appropriate Message-ID: <20070423140642.3920579e@ironwood.lan> In-Reply-To: <20070423165646.GA15110@caradoc.them.org> References: <20070420163312.56701614@ironwood.lan> <200704231505.l3NF5KV5025451@d12av02.megacenter.de.ibm.com> <20070423094900.15a047d2@ironwood.lan> <20070423165646.GA15110@caradoc.them.org> X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.10.4; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00314.txt.bz2 On Mon, 23 Apr 2007 12:56:46 -0400 Daniel Jacobowitz wrote: > On Mon, Apr 23, 2007 at 09:49:00AM -0700, Kevin Buettner wrote: > > We can't use address_from_register() in this instance since > > dwarf2_read_address() is not fetching an address from a register, but > > rather from some DWARF2 info. > > How about value_as_address? I don't like the need for another call > site for gdbarch_integer_to_address; it's historically tricky... dwarf2_read_address() isn't reading an address from some value in the inferior, but rather is decoding some sequence of bytes as an address in the DWARF2 info. As such, dwarf2_read_address() doesn't have anything readily available to pass to value_as_address(). That means that a suitable value would have to be constructed and then immediately decomposed, leading to an expression which might look something like this: result = value_as_address (value_from_longest (unsigned_address_type (), extract_unsigned_integer (buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT))); Please let me know if this is what you had in mind. If so, I'll try it out and post the results. Kevin