1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
-- Bug handling
-- Copyright (C) 2002, 2003, 2004, 2005 Tristan Gingold
--
-- GHDL is free software; you can redistribute it and/or modify it under
-- the terms of the GNU General Public License as published by the Free
-- Software Foundation; either version 2, or (at your option) any later
-- version.
--
-- GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
-- WARRANTY; without even the implied warranty of MERCHANTABILITY or
-- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-- for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with GCC; see the file COPYING. If not, write to the Free
-- Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-- 02111-1307, USA.
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Command_Line; use Ada.Command_Line;
with GNAT.Directory_Operations;
with Version; use Version;
package body Bug is
-- Declared in the files generated by gnatbind.
-- Note: since the string is exported with C convension, there is no way
-- to know the length (gnat1 crashes if the string is unconstrained).
-- Hopefully, the format of the string seems to be fixed.
GNAT_Version : constant String (1 .. 31);
pragma Import (C, GNAT_Version, "__gnat_version");
procedure Disp_Bug_Box (Except : Exception_Occurrence)
is
Id : Exception_Id;
begin
New_Line (Standard_Error);
Put_Line
(Standard_Error,
"******************** GHDL Bug occured ****************************");
Put_Line
(Standard_Error,
"Please, report this bug to ghdl@free.fr, with all the output.");
Put_Line (Standard_Error, "GHDL version: " & Ghdl_Version);
Put_Line (Standard_Error, "Compiled with " & GNAT_Version);
Put_Line (Standard_Error, "In directory: " &
GNAT.Directory_Operations.Get_Current_Dir);
--Put_Line
-- ("Program name: " & Command_Name);
--Put_Line
-- ("Program arguments:");
--for I in 1 .. Argument_Count loop
-- Put_Line (" " & Argument (I));
--end loop;
Put_Line (Standard_Error, "Command line:");
Put (Standard_Error, Command_Name);
for I in 1 .. Argument_Count loop
Put (Standard_Error, ' ');
Put (Standard_Error, Argument (I));
end loop;
New_Line (Standard_Error);
Id := Exception_Identity (Except);
if Id /= Null_Id then
Put_Line (Standard_Error,
"Exception " & Exception_Name (Id) & " raised");
--Put_Line ("exception message: " & Exception_Message (Except));
Put_Line (Standard_Error,
"Exception information:");
Put (Standard_Error, Exception_Information (Except));
end if;
Put_Line
(Standard_Error,
"******************************************************************");
end Disp_Bug_Box;
end Bug;
|