From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27721 invoked by alias); 31 Oct 2007 02:18:25 -0000 Received: (qmail 27710 invoked by uid 22791); 31 Oct 2007 02:18:25 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 31 Oct 2007 02:18:23 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 4AF0C98348; Wed, 31 Oct 2007 02:18:22 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 24A8B980A5; Wed, 31 Oct 2007 02:18:22 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1In39x-00085K-Cl; Tue, 30 Oct 2007 22:18:21 -0400 Date: Wed, 31 Oct 2007 04:47:00 -0000 From: Daniel Jacobowitz To: Ulrich Weigand Cc: gdb-patches@sourceware.org Subject: Re: dwarf2-frame.c read_reg problems, again ... Message-ID: <20071031021821.GB30157@caradoc.them.org> Mail-Followup-To: Ulrich Weigand , gdb-patches@sourceware.org References: <200710310151.l9V1pTLb008147@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200710310151.l9V1pTLb008147@d12av02.megacenter.de.ibm.com> User-Agent: Mutt/1.5.15 (2007-04-09) 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-10/txt/msg00842.txt.bz2 On Wed, Oct 31, 2007 at 02:51:29AM +0100, Ulrich Weigand wrote: > With the patch refered to above, read_reg will respect the > signedness of the register_type, if it is an integral type. > This is not a problem if the register type is a pointer type > (in which case pointer_to_address would be consulted), but > on ppc the CFA gets computed from regular general purpose > registers, with an integral register_type. > > Those in turn used to be described as "builtin_type_uint32" > by the original rs6000_register_type. The generic XML-based > machinery now apparently uses a signed integer type instead, > exposing the problem. This was plainly and simply a mistake. While I agree that changing them back is not a real solution to the problem you've found, I didn't mean to flip the signedness of all those registers. If uint32 is in any sense more architecturally appropriate, or even for sheer tradition, let's flip them back. > Now I'm wondering: what was the motivation behind using > unpack_long here? The dwarf2loc.c:dwarf_expr_read_reg > routine, which saves basically the same purpose, now uses > address_from_register -- i.e. specifically treats the > value as pointer, not integer ... I think we have about five too many ways to take a register and make it into a number. On the other hand, dwarf_expr_read_reg uses builtin_type_void_data_ptr. That is probably broken on whatever target Michael Snyder was trying to fix in the patch you referenced, where the sizes differ. If we use address_from_register, we will end up in a call to unpack_long using the provided type. So I think that is exactly the same as what we have now. This is the trouble with using a host integer type to represent target addresses. If we did all our arithmetic on opaque CORE_ADDR's, this wouldn't happen. I wonder if there's no getting around the need to define a sensible calculus for them... -- Daniel Jacobowitz CodeSourcery