public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH pascal] Accept char with integer values outside 0..255 range in pascal_one_char function
@ 2010-04-16  8:15 Pierre Muller
  0 siblings, 0 replies; only message in thread
From: Pierre Muller @ 2010-04-16  8:15 UTC (permalink / raw)
  To: gdb-patches

  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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-04-16  8:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-16  8:15 [PATCH pascal] Accept char with integer values outside 0..255 range in pascal_one_char function Pierre Muller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).