This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: [RFC] Signed/unsigned character arrays are not strings
On Sun, 25 Feb 2007 08:59:41 +0100, mathieu lacage wrote:
...
> I don't know how useful that is to you but a lot of people (the first
> which comes to my mind is libxml2) decided to use "unsigned char *" to
> identify utf-8 encoded strings in C.
Together with the attached RMS's response I became more inclined to revert this
change and provide only "$xmm"-specific fix instead (probably for the GDB
int8_t/uint8_t internal types).
OK to submit the patch?
Jan
--- Begin Message ---
- From: Richard Stallman <rms at gnu dot org>
- To: Nick Roberts <nickrob at snap dot net dot nz>
- Cc: jan dot kratochvil at redhat dot com
- Cc: bug-gdb at gnu dot org
- Date: Sun, 25 Feb 2007 14:30:23 -0500
- Subject: Re: Emacs .gdbinit incompatible with latest GDB
- References: <200702242133.l1OLXKff004169@host0.dyn.jankratochvil.net> <17889.3323.360519.26769@kahikatea.snap.net.nz>
- Reply-to: rms at gnu dot org
the recent GDB has problems running GDB `xbacktrace' on EMACS
http://sources.redhat.com/ml/gdb/2007-02/msg00252.html
It seems clear why the change was made:
On the other hand byte arrays become unreadable if printed as strings.
However, it seems that their hope this would not bother anyone was based
on an assumption which is inaccurate:
I hope nobody uses sign-specification for strings.
Which GDB behavior is better is a matter of how often each one is
convenient and how often it causes trouble. I don't know enough to
have an opinion about that, but if neither one is clearly better
overall, it would be best to leave GDB the way it was.
--- End Message ---
--- Begin Message ---
- From: Richard Stallman <rms at gnu dot org>
- To: Nick Roberts <nickrob at snap dot net dot nz>
- Cc: jan dot kratochvil at redhat dot com, emacs-pretest-bug at gnu dot org
- Date: Sun, 25 Feb 2007 14:30:24 -0500
- Subject: Re: Emacs .gdbinit incompatible with latest GDB
- References: <200702242133.l1OLXKff004169@host0.dyn.jankratochvil.net> <17889.3323.360519.26769@kahikatea.snap.net.nz>
- Reply-to: rms at gnu dot org
2000-01-04 Gerd Moellmann <gerd@gnu.org>
* lisp.h (struct Lisp_String): Make DATA member `unsigned char *'.
I guess the questions to ask are:
1) Why was this change made?
Probably to make it easier to avoid incorrect conversions when
extracting elements. We don't want to get negative numbers
for byte values above 127.
--- End Message ---