aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/comperr.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2007-04-06 11:41:46 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2007-04-06 11:41:46 +0200
commit8405d93cb85e88f95daae9de30039cc9745f507d (patch)
treec6f6dd10e9c3e6978354a61ce48fdb5c9e6a3be9 /gcc/ada/comperr.adb
parent737053d61e42154666df468ddc9caacfd173eaab (diff)
downloadgcc-8405d93cb85e88f95daae9de30039cc9745f507d.zip
gcc-8405d93cb85e88f95daae9de30039cc9745f507d.tar.gz
gcc-8405d93cb85e88f95daae9de30039cc9745f507d.tar.bz2
gnatvsn.ads, [...] (Get_Gnat_build_Type): Renamed Build_Type and made constant.
2007-04-06 Arnaud Charlet <charlet@adacore.com> Eric Botcazou <botcazou@adacore.com> * gnatvsn.ads, comperr.adb (Get_Gnat_build_Type): Renamed Build_Type and made constant. * comperr.ads, comperr.adb (Compiler_Abort): Add third parameter Fallback_Loc. Use it as the sloc info when Current_Error_Node doesn't carry any. * fe.h (Compiler_Abort): Add third parameter. * misc.c (internal_error_function): Build third argument from current input location and pass it to Compiler_Abort. From-SVN: r123610
Diffstat (limited to 'gcc/ada/comperr.adb')
-rw-r--r--gcc/ada/comperr.adb21
1 files changed, 13 insertions, 8 deletions
diff --git a/gcc/ada/comperr.adb b/gcc/ada/comperr.adb
index 648c4b1..e8a502c 100644
--- a/gcc/ada/comperr.adb
+++ b/gcc/ada/comperr.adb
@@ -71,8 +71,9 @@ package body Comperr is
--------------------
procedure Compiler_Abort
- (X : String;
- Code : Integer := 0)
+ (X : String;
+ Code : Integer := 0;
+ Fallback_Loc : String := "")
is
-- The procedures below output a "bug box" with information about
-- the cause of the compiler abort and about the preferred method
@@ -96,8 +97,8 @@ package body Comperr is
Write_Eol;
end End_Line;
- Is_GPL_Version : constant Boolean := Get_Gnat_Build_Type = GPL;
- Is_FSF_Version : constant Boolean := Get_Gnat_Build_Type = FSF;
+ Is_GPL_Version : constant Boolean := Gnatvsn.Build_Type = GPL;
+ Is_FSF_Version : constant Boolean := Gnatvsn.Build_Type = FSF;
-- Start of processing for Compiler_Abort
@@ -213,10 +214,14 @@ package body Comperr is
-- Output source location information
- if Sloc (Current_Error_Node) <= Standard_Location
- or else Sloc (Current_Error_Node) = No_Location
- then
- Write_Str ("| No source file position information available");
+ if Sloc (Current_Error_Node) <= No_Location then
+ if Fallback_Loc'Length > 0 then
+ Write_Str ("| Error detected around ");
+ Write_Str (Fallback_Loc);
+ else
+ Write_Str ("| No source file position information available");
+ end if;
+
End_Line;
else
Write_Str ("| Error detected at ");