Commit 28e33720 by Arnaud Charlet Committed by Pierre-Marie de Rodat

[Ada] Do not print non ASCII characters in debug routines

2018-05-25  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* pprint.adb (Expression_Name): Do not print non ASCII characters.

From-SVN: r260720
parent 5a7aacd1
2018-05-25 Arnaud Charlet <charlet@adacore.com>
* pprint.adb (Expression_Name): Do not print non ASCII characters.
2018-05-25 Bob Duff <duff@adacore.com> 2018-05-25 Bob Duff <duff@adacore.com>
* libgnat/a-strunb__shared.ads, libgnat/a-stwiun__shared.ads, * libgnat/a-strunb__shared.ads, libgnat/a-stwiun__shared.ads,
......
...@@ -213,8 +213,7 @@ package body Pprint is ...@@ -213,8 +213,7 @@ package body Pprint is
when N_Character_Literal => when N_Character_Literal =>
declare declare
Char : constant Int := Char : constant Int := UI_To_Int (Char_Literal_Value (Expr));
UI_To_Int (Char_Literal_Value (Expr));
begin begin
if Char in 32 .. 127 then if Char in 32 .. 127 then
return "'" & Character'Val (Char) & "'"; return "'" & Character'Val (Char) & "'";
...@@ -890,6 +889,15 @@ package body Pprint is ...@@ -890,6 +889,15 @@ package body Pprint is
if Right /= Expr then if Right /= Expr then
while Scn < End_Sloc loop while Scn < End_Sloc loop
case Src (Scn) is 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 ' ' when ' '
| ASCII.HT | ASCII.HT
=> =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment