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
|
Procedure InternalExit;
var
current_exit : Procedure;
Begin
while exitProc<>nil Do
Begin
InOutRes:=0;
current_exit:=tProcedure(exitProc);
exitProc:=nil;
current_exit();
End;
{ Finalize units }
FinalizeUnits;
{ Show runtime error and exit }
If erroraddr<>nil Then
Begin
Writeln(stdout,'Runtime error ',Errorcode,' at $',hexstr(PtrInt(Erroraddr),sizeof(PtrInt)*2));
{ to get a nice symify }
Writeln(stdout,BackTraceStrFunc(Erroraddr));
dump_stack(stdout,ErrorBase);
Writeln(stdout,'');
End;
{ Make sure that all output is written to the redirected file }
Flush(Output);
Flush(ErrOutput);
Flush(StdOut);
Flush(StdErr);
End; |
Partager