Re: [PATCH] Print vector registers in natural format, not hex

Daniel Jacobowitz
2002-11-05T04:34:43Z

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