- C8E02554AEE5416547ABB98155180F184AA11184825A76E1D119D291ACCBA55E33565DC3868BF42198C880A0CCA3CF6B8B329AD9703EB01C0781D5049AC06A44
+ EC06F5D03656946C1D7F682FA5192EF8BD3C8D460E5BD8B9F0DC1DE36B6AA549F1B8FE1E0525D3A660C8A8AB1928AA05868359EC4B838D2D951C5FF672B2D93E
zfp/adainclude/last_chance_handler.adb
(12 . 34)(12 . 27)
64 ------------------------------------------------------------------------------
65 ------------------------------------------------------------------------------
66
67 with Ada.Text_IO; use Ada.Text_IO;
68 with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
69 with Ada.Text_IO; use Ada.Text_IO;
70 with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
71 with System.Storage_Elements; use System.Storage_Elements;
72 with System.Syscall; use System.Syscall;
73
74 procedure Last_Chance_Handler
75 (Msg : System.Address; Line : Integer)
76 is
77 procedure Exit_Now(status: Integer);
78 pragma Import
79 (Convention => C,
80 Entity => Exit_Now,
81 External_Name => "exit");
82
83 function Peek (Addr : System.Address) return Character
84 is
85 C : Character with Address => Addr;
86 procedure Last_Chance_Handler (Msg : System.Address; Line : Integer) is
87 function Peek (Addr : System.Address) return Character is
88 C : Character with
89 Address => Addr;
90 begin
91 return C;
92 end Peek;
93 end Peek;
94 A : System.Address := Msg;
95 begin
96 Put ("GNAT Exception!:");
97 Put (Line);
98 Put (Line);
99 Put (":");
100 while Peek(A) /= ASCII.NUL loop
101 Put (Peek(A));
102 while Peek (A) /= ASCII.NUL loop
103 Put (Peek (A));
104 A := A + 1;
105 end loop;
106 New_Line;
107 Exit_Now(-1);
108 Sys_Exit (1);
109 end Last_Chance_Handler;