From: Arnaud Charlet Date: Fri, 25 May 2018 09:03:24 +0000 (+0000) Subject: [Ada] Do not print non ASCII characters in debug routines X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=28e3372094a60b1d7fb9d076a29b050761e5692a;p=gcc.git [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 --- 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 =>