This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC] Signed/unsigned character arrays are not strings


Hi,

currently all these types are printed as strings:
	char
	signed char
	unsigned char
the patch will reduce the printed strings only to
	char
and the signed/unsigned version gets printed as an array of byte values
(characters).  I hope nobody uses sign-specification for strings.
On the other hand byte arrays become unreadable if printed as strings.

Testsuite updated in multiple cases appropriately.
Bugreported by Ulrich Drepper.


Unpatched:
(gdb) p $xmm1
$1 = {v4_float = {1, 1.25, 1.5, 1.75}, v2_double = {0.031250007392372936, 0.50000011874362826}, 
  v16_int8 = "\000\000\200?\000\000ï?\000\000ï?\000\000ï?", v8_int16 = {0, 16256, 0, 16288, 0, 16320, 0, 16352}, v4_int32 = {
    1065353216, 1067450368, 1069547520, 1071644672}, v2_int64 = {4584664421728518144, 4602678820242194432}, 
  uint128 = 0x3fe000003fc000003fa000003f800000}

Patched:
(gdb) p $xmm1
$1 = {v4_float = {1, 1.25, 1.5, 1.75}, v2_double = {0.031250007392372936, 0.50000011874362826}, v16_int8 = {0 '\0', 0 '\0', 
    -128 '\200', 63 '?', 0 '\0', 0 '\0', -96 'ï', 63 '?', 0 '\0', 0 '\0', -64 'ï', 63 '?', 0 '\0', 0 '\0', -32 'ï', 63 '?'}, 
  v8_int16 = {0, 16256, 0, 16288, 0, 16320, 0, 16352}, v4_int32 = {1065353216, 1067450368, 1069547520, 1071644672}, 
  v2_int64 = {4584664421728518144, 4602678820242194432}, uint128 = 0x3fe000003fc000003fa000003f800000}



Regards,
Jan

Attachment: gdb-cvs-nosign-array.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]