From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23112 invoked by alias); 6 Jun 2005 13:56:31 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 23081 invoked by uid 22791); 6 Jun 2005 13:56:28 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 06 Jun 2005 13:56:28 +0000 Received: from drow by nevyn.them.org with local (Exim 4.50) id 1DfI5Z-00077j-CR; Mon, 06 Jun 2005 09:56:25 -0400 Date: Mon, 06 Jun 2005 13:56:00 -0000 From: Daniel Jacobowitz To: Vladimir Prus Cc: gdb@sources.redhat.com Subject: Re: printing "variable-sized" registers Message-ID: <20050606135625.GA27290@nevyn.them.org> Mail-Followup-To: Vladimir Prus , gdb@sources.redhat.com References: <20050530165817.GA24005@nevyn.them.org> <200506061752.08077.ghost@cs.msu.su> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200506061752.08077.ghost@cs.msu.su> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-06/txt/msg00045.txt.bz2 On Mon, Jun 06, 2005 at 05:52:07PM +0400, Vladimir Prus wrote: > > The last one. The best you can do the rest of the time is going to be > > giving them a type containing the maximum number of values and fill in > > with dummies - maybe also including the count? > > This's what I was doing -- assigning "array of 32 uin64s" type to those > registers and they are printed with "info all-registers", but the dummy > values do no look nice when presented to the user. Right. You can correct how they're printed in info registers and info all-registers by providing your own print_registers_info. > > If you want "print $reg" to display them nicely, you're going to need > > to teach GDB's type system about it somehow. I have no idea what that > > change would look like or how it would work, but it could be generally > > useful - it's the same concept as prettyprinting a tagged union, I think. > > Ok, understood. With the attached patch I get what I want, but I have no idea > if this patch is good or not. No, I don't think this is an acceptable way to do it - too inelegant. I don't know. -- Daniel Jacobowitz CodeSourcery, LLC