print-tree.c (print_node): In a STRING_CST...

* print-tree.c (print_node):  In a STRING_CST, escape non-ascii
	characters, and only print TREE_STRING_LENGTH chars.

From-SVN: r56994
This commit is contained in:
Per Bothner 2002-09-10 00:02:28 -07:00 committed by Per Bothner
parent 278bba8be6
commit 9038942205
2 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2002-09-09 Per Bothner <per@bothner.com>
* print-tree.c (print_node): In a STRING_CST, escape non-ascii
characters, and only print TREE_STRING_LENGTH chars.
2002-09-09 Steve Ellcey <sje@cup.hp.com>
* config/ia64/hpux.h (TARGET_HPUX_LD): New, define true.

View File

@ -711,7 +711,20 @@ print_node (file, prefix, node, indent)
break;
case STRING_CST:
fprintf (file, " \"%s\"", TREE_STRING_POINTER (node));
{
const char *p = TREE_STRING_POINTER (node);
int i = TREE_STRING_LENGTH (node);
fputs (" \"", file);
while (--i >= 0)
{
char ch = *p++;
if (ch >= ' ' && ch < 127)
putc (ch, file);
else
fprintf(file, "\\%03o", ch & 0xFF);
}
fputc ('\"', file);
}
/* Print the chain at second level. */
if (indent == 4)
print_node (file, "chain", TREE_CHAIN (node), indent + 4);