aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/comperr.adb
diff options
context:
space:
mode:
authorRonan Desplanques <desplanques@adacore.com>2024-09-04 15:27:01 +0200
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-10-08 10:37:12 +0200
commit65491166ddbc83b7283b42dc6d6451668acd9f22 (patch)
tree5e300aeb7a8e7971f18b9246526431ea534434c9 /gcc/ada/comperr.adb
parent45131b851522180c532bebb3521865e488025af0 (diff)
downloadgcc-65491166ddbc83b7283b42dc6d6451668acd9f22.zip
gcc-65491166ddbc83b7283b42dc6d6451668acd9f22.tar.gz
gcc-65491166ddbc83b7283b42dc6d6451668acd9f22.tar.bz2
ada: Add adareducer integration to ICE handling
This patch adds a way to have the adareducer tool run on a appropriate set of files when GNAT crashes. This feature is behind the -gnatd_m debugging switch. gcc/ada/ChangeLog: * comperr.adb (Compiler_Abort): Add call to Generate_Minimal_Reproducer and replace call to Namet.Unlock with call to Unlock_If_Locked. * debug.adb: Document new purpose of -gnatd_m and -gnatd_M. * fname-uf.adb (Instantiate_SFN_Pattern): New procedure. (Get_Default_File_Name): New function. (Get_File_Name): Replace inline code with call to Instantiate_SFN_Pattern. * fname-uf.ads (Get_Default_File_Name): New function. * generate_minimal_reproducer.adb (Generate_Minimal_Reproducer): New procedure. * namet.adb (Unlock_If_Locked): New function. * namet.ads (Unlock_If_Locked): Likewise. * par-prag.adb (Prag): Add special behavior with -gnatd_M. * set_targ.adb: Minor fixes to comments. * gcc-interface/Make-lang.in: Update list of object files.
Diffstat (limited to 'gcc/ada/comperr.adb')
-rw-r--r--gcc/ada/comperr.adb12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ada/comperr.adb b/gcc/ada/comperr.adb
index 2623eed..e411ddb 100644
--- a/gcc/ada/comperr.adb
+++ b/gcc/ada/comperr.adb
@@ -30,6 +30,7 @@
with Atree; use Atree;
with Debug; use Debug;
with Errout; use Errout;
+with Generate_Minimal_Reproducer;
with Gnatvsn; use Gnatvsn;
with Lib; use Lib;
with Namet; use Namet;
@@ -263,7 +264,7 @@ package body Comperr is
Src : Source_Buffer_Ptr;
begin
- Namet.Unlock;
+ Namet.Unlock_If_Locked;
Name_Buffer (1 .. 12) := "gnat_bug.box";
Name_Len := 12;
Read_Source_File (Name_Enter, 0, Hi, Src, FD);
@@ -403,6 +404,14 @@ package body Comperr is
Write_Str ("list may be incomplete");
end;
+ begin
+ if Debug_Flag_Underscore_M then
+ Generate_Minimal_Reproducer;
+ end if;
+ exception
+ when others => null;
+ end;
+
Write_Eol;
Set_Standard_Output;
@@ -539,5 +548,4 @@ package body Comperr is
Write_Char (After);
end Repeat_Char;
-
end Comperr;