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

Klee Dienes
2002-11-05T04:02:10Z

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