[PATCH] Escape non-printable chars in dumped strings.

Martin Liška mliska@suse.cz
Fri Dec 9 10:05:00 GMT 2016


On 12/09/2016 11:00 AM, Richard Biener wrote:
> On Thu, Dec 8, 2016 at 2:37 PM, Martin Liška <mliska@suse.cz> wrote:
>> Hello.
>>
>> Following patch changes behavior in pretty_print_string, where all non-printable
>> characters are encoded as \x%x. Currently, when some non-printable characters are directly
>> printed to a dump file stream. That makes it complicated to read a dump file for instance
>> via a Python script.
>>
>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>>
>> Ready to be installed?
> 
> Ok.  Does ISPRINT ('\') yield true or false?  That is, I suppose we
> want to escape that?

You mean '\\', which is already covered by a case:

	case '\\':
	  pp_string (pp, "\\\\");
	  break;

I'm going to install the patch.

Martin


> 
>> Martin



More information about the Gcc-patches mailing list