aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/pprint.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2018-05-25 09:04:32 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-05-25 09:04:32 +0000
commit29192f7b77e67ae3bee0138bd0f7262e899226ab (patch)
tree865b7cf2db529619345f4bddd61657241d68286a /gcc/ada/pprint.adb
parent733a4a3dbc7873df5749f70a1563ea816efe7146 (diff)
downloadgcc-29192f7b77e67ae3bee0138bd0f7262e899226ab.zip
gcc-29192f7b77e67ae3bee0138bd0f7262e899226ab.tar.gz
gcc-29192f7b77e67ae3bee0138bd0f7262e899226ab.tar.bz2
[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
Diffstat (limited to 'gcc/ada/pprint.adb')
-rw-r--r--gcc/ada/pprint.adb7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/pprint.adb b/gcc/ada/pprint.adb
index 24c9aa1..230a3d3 100644
--- a/gcc/ada/pprint.adb
+++ b/gcc/ada/pprint.adb
@@ -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;