Commit 29192f7b by Arnaud Charlet Committed by Pierre-Marie de Rodat

[Ada] Strip too long expressions in debug routines

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

gcc/ada/

	* pprint.adb (Expression_Name): Strip too long expressions to avoid
	carrying very large strings.

From-SVN: r260732
parent 733a4a3d
2018-05-25 Arnaud Charlet <charlet@adacore.com>
* pprint.adb (Expression_Name): Strip too long expressions to avoid
carrying very large strings.
2018-05-25 Patrick Bernardi <bernardi@adacore.com>
* switch-b.adb (Scan_Binder_Switches): binder switch -Q accepts Natural
......
......@@ -883,6 +883,7 @@ package body Pprint is
end if;
declare
Threshold : constant := 256;
Buffer : String (1 .. Natural (End_Sloc - Scn));
Index : Natural := 0;
Skipping_Comment : Boolean := False;
......@@ -935,6 +936,12 @@ package body Pprint is
end if;
end case;
-- Give up on too long strings
if Index >= Threshold then
return Buffer (1 .. Index) & "...";
end if;
Scn := Scn + 1;
end loop;
end if;
......
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