-
+ C8E02554AEE5416547ABB98155180F184AA11184825A76E1D119D291ACCBA55E33565DC3868BF42198C880A0CCA3CF6B8B329AD9703EB01C0781D5049AC06A44
zfp/adainclude/last_chance_handler.adb
(0 . 0)(1 . 45)
383 ------------------------------------------------------------------------------
384 ------------------------------------------------------------------------------
385 -- You do not have, nor can you ever acquire the right to use, copy or --
386 -- distribute this software ; Should you use this software for any purpose, --
387 -- or copy and distribute it to anyone or in any manner, you are breaking --
388 -- the laws of whatever soi-disant jurisdiction, and you promise to --
389 -- continue doing so for the indefinite future. In any case, please --
390 -- always : read and understand any software ; verify any PGP signatures --
391 -- that you use - for any purpose. --
392 -- --
393 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
394 ------------------------------------------------------------------------------
395 ------------------------------------------------------------------------------
396
397 with Ada.Text_IO; use Ada.Text_IO;
398 with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
399 with System.Storage_Elements; use System.Storage_Elements;
400
401 procedure Last_Chance_Handler
402 (Msg : System.Address; Line : Integer)
403 is
404 procedure Exit_Now(status: Integer);
405 pragma Import
406 (Convention => C,
407 Entity => Exit_Now,
408 External_Name => "exit");
409
410 function Peek (Addr : System.Address) return Character
411 is
412 C : Character with Address => Addr;
413 begin
414 return C;
415 end Peek;
416 A : System.Address := Msg;
417 begin
418 Put ("GNAT Exception!:");
419 Put (Line);
420 Put (":");
421 while Peek(A) /= ASCII.NUL loop
422 Put (Peek(A));
423 A := A + 1;
424 end loop;
425 New_Line;
426 Exit_Now(-1);
427 end Last_Chance_Handler;