This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] Print vector registers in natural format, not hex
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Klee Dienes <klee at apple dot com>
- Cc: Elena Zannoni <ezannoni at redhat dot com>, gdb-patches at sources dot redhat dot com
- Date: Mon, 4 Nov 2002 23:35:25 -0500
- Subject: Re: [PATCH] Print vector registers in natural format, not hex
- References: <15792.38707.400671.968851@localhost.redhat.com> <5769348C-F073-11D6-8361-00039396EEB8@apple.com>
I absolutely agree. I ran into this a couple of days ago and wasted
ten minutes figuring out how big my array was again, anyway...
On Mon, Nov 04, 2002 at 11:02:03PM -0500, Klee Dienes wrote:
> I think it's definitely a misfeature. It's would be different if GDB
> were skipping all the trailing nulls, and not just the final null ...
> but either way, I think it's the wrong behavior. An array is an array,
> not a string, and printing:
>
> $1 = "abcd\000\000\000\000\000"
>
> instead of
>
> $1 = "abcd\000\000\000\000\000\000"
>
> for 'char buf[10] = "hello"'
>
> just seems much more confusing than useful.
>
> On Friday, October 18, 2002, at 07:20 PM, Elena Zannoni wrote:
> >
> >And you haven't noticed this comment in the testfile, I take it :-) I
> >discovered this while writing the vector support, but didn't fix it. I
> >don't know that it actually needs to be fixed. It's a feature, not a
> >bug, one could argue.
> >
> ># Note: in LE case, the char array is printed WITHOUT the last
> >character.
> ># Gdb treats the terminating null char in the array like the
> >terminating
> ># null char in a string and doesn't print it. This is not a failure,
> >but
> ># the way gdb works.
> >
> >Elena
>
>
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer