This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH pascal] Accept char with integer values outside 0..255 range in pascal_one_char function
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: <gdb-patches at sourceware dot org>
- Date: Fri, 16 Apr 2010 10:15:07 +0200
- Subject: [PATCH pascal] Accept char with integer values outside 0..255 range in pascal_one_char function
I committed the following patch to GDB.
There is no reason to coerce the value of the char to the 0..255 range
for pascal char display.
Any char that is outside this range will be displayed as
#numeric_value_in-decimal_form
The additional test ((unsigned int) c <= 0xff is here because
PRINT_LITTERAL_FORM does not seem to handle values outside the 0..0xff
range as expected.
Pierre Muller
Pascal language support maintainer for GDB
ChangeLog entry:
2010-04-16 Pierre Muller <muller@ics.u-strasbg.fr>
* p-lang.c (pascal_one_char): Do not restrict C to 0..255 range.
Index: p-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/p-lang.c,v
retrieving revision 1.52
diff -u -p -r1.52 p-lang.c
--- p-lang.c 9 Mar 2010 08:30:54 -0000 1.52
+++ p-lang.c 16 Apr 2010 08:07:49 -0000
@@ -158,9 +158,7 @@ static void
pascal_one_char (int c, struct ui_file *stream, int *in_quotes)
{
- c &= 0xFF; /* Avoid sign bit follies */
-
- if ((c == '\'') || (PRINT_LITERAL_FORM (c)))
+ if (c == '\'' || ((unsigned int) c <= 0xff && (PRINT_LITERAL_FORM (c))))
{
if (!(*in_quotes))
fputs_filtered ("'", stream);