From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24869 invoked by alias); 21 Jun 2006 10:59:27 -0000 Received: (qmail 24861 invoked by uid 22791); 21 Jun 2006 10:59:27 -0000 X-Spam-Check-By: sourceware.org Received: from Unknown (HELO cam-admin0.cambridge.arm.com) (193.131.176.58) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 21 Jun 2006 10:59:22 +0000 Received: from cam-owa1.Emea.Arm.com (cam-owa1.emea.arm.com [10.1.255.62]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id k5LAwSZ8024284; Wed, 21 Jun 2006 11:58:28 +0100 (BST) Received: from pc960.cambridge.arm.com ([10.1.255.211]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 21 Jun 2006 11:58:27 +0100 Subject: Re: [rfa] Use better types for ARM registers From: Richard Earnshaw To: Daniel Jacobowitz Cc: gdb-patches@sourceware.org In-Reply-To: <20060620194545.GA32554@nevyn.them.org> References: <20060620194545.GA32554@nevyn.them.org> Content-Type: text/plain Message-Id: <1150887507.25267.8.camel@pc960.cambridge.arm.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 21 Jun 2006 10:59:00 -0000 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-06/txt/msg00310.txt.bz2 On Tue, 2006-06-20 at 20:45, Daniel Jacobowitz wrote: > This patch switches pc and sp to pointer types, and other registers > from int32 to uint32. The pc switch follows in the footsteps of a > clever idea that I last remember seeing from Mark Kettenis: > > (gdb) i reg pc > pc 0x83a4 0x83a4 > > The uint32 change is both cosmetic (I think it's less messy) and > necessary. I recently committed this, after a bug report from Michael > and some discussion: > > 2006-05-17 Daniel Jacobowitz > > * dwarf2-frame.c: Include "value.h". > (read_reg): Use unpack_long and register_type. > * Makefile.in (dwarf2-frame.o): Update. > > An unexpected consequence is that if the CFA comes from a register with > a signed type, and the host is 64-bit (like my amd64 desktop), the CFA > will be extended in the dwarf2 frame ID. This causes "stack > corruption" messages because we think it's way outside of the previous > frame. So, fix and prettify, at the same time. > > OK? I can't see any problems with this. Abstractly, registers are just buckets of bits, it's the use context that determines whether they are signed or unsigned (or something else entirely). In some ways it might be nice if we could enforce all interpretation of the bits to be explicit, but I can see that might be an unnecessary overhead. I guess interpreting the value by default as unsigned is closer to my ideal than defaulting to signed. R. One of the things that has always frustrated me with GDB is to print out the value of an integer register (or pair of such registers) as a floating point value -- ie, there's no obvious way to do the equivalent of *(double*)®num.