[RFC] Signed/unsigned character arrays are not strings
Nick Roberts
nickrob@snap.net.nz
Sat Feb 24 16:13:00 GMT 2007
On Thu, 25 Jan 2007 02:54:22 +0100, Jan Kratochvil wrote (gdb-patches):
> 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.
Emacs uses sign-specification for strings. There is a user defined command
called xbacktrace that prints a backtrace of Lisp functions. Previously it
got printed like:
(gdb) xbacktrace
"split-window" (0x838c8c9)
"split-window-vertically" (0x838c8c9)
"call-interactively" (0x85b3ac9)
It now gets printed as:
(gdb) xbacktrace
{115 's', 112 'p', 108 'l', 105 'i', 116 't', 45 '-', 119 'w', 105 'i',
110 'n', 100 'd', 111 'o', 119 'w'} (0x838c8c9)
{115 's', 112 'p', 108 'l', 105 'i', 116 't', 45 '-', 119 'w', 105 'i',
110 'n', 100 'd', 111 'o', 119 'w', 45 '-', 118 'v', 101 'e', 114 'r',
116 't', 105 'i', 99 'c', 97 'a', 108 'l', 108 'l', 121 'y'} (0x838c8c9)
{99 'c', 97 'a', 108 'l', 108 'l', 45 '-', 105 'i', 110 'n', 116 't', 101 'e',
114 'r', 97 'a', 99 'c', 116 't', 105 'i', 118 'v', 101 'e', 108 'l',
121 'y'} (0x85b3ac9)
--
Nick http://www.inet.net.nz/~nickrob
More information about the Gdb
mailing list