This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: printing "variable-sized" registers
- From: Daniel Jacobowitz <drow at false dot org>
- To: Vladimir Prus <ghost at cs dot msu dot su>
- Cc: gdb at sources dot redhat dot com
- Date: Mon, 6 Jun 2005 09:56:25 -0400
- Subject: Re: printing "variable-sized" registers
- References: <d7f7dt$b3u$1@sea.gmane.org> <20050530165817.GA24005@nevyn.them.org> <200506061752.08077.ghost@cs.msu.su>
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