From 28e3372094a60b1d7fb9d076a29b050761e5692a Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 25 May 2018 09:03:24 +0000 Subject: [PATCH] [Ada] Do not print non ASCII characters in debug routines 2018-05-25 Arnaud Charlet gcc/ada/ * pprint.adb (Expression_Name): Do not print non ASCII characters. From-SVN: r260720 --- gcc/ada/ChangeLog | 4 ++++ gcc/ada/pprint.adb | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 1b95eb53d2f..3f183c38520 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2018-05-25 Arnaud Charlet + + * pprint.adb (Expression_Name): Do not print non ASCII characters. + 2018-05-25 Bob Duff * libgnat/a-strunb__shared.ads, libgnat/a-stwiun__shared.ads, diff --git a/gcc/ada/pprint.adb b/gcc/ada/pprint.adb index aa793d80f7b..53354ae7ba2 100644 --- a/gcc/ada/pprint.adb +++ b/gcc/ada/pprint.adb @@ -213,8 +213,7 @@ package body Pprint is when N_Character_Literal => declare - Char : constant Int := - UI_To_Int (Char_Literal_Value (Expr)); + Char : constant Int := UI_To_Int (Char_Literal_Value (Expr)); begin if Char in 32 .. 127 then return "'" & Character'Val (Char) & "'"; @@ -890,6 +889,15 @@ package body Pprint is if Right /= Expr then while Scn < End_Sloc loop case Src (Scn) is + + -- Give up on non ASCII characters + + when Character'Val (128) .. Character'Last => + Append_Paren := 0; + Index := 0; + Right := Expr; + exit; + when ' ' | ASCII.HT => -- 2.30.2