|
@@ -671,6 +671,7 @@ Procedure FinalizeHeap;forward;
|
|
Procedure InternalExit;
|
|
Procedure InternalExit;
|
|
var
|
|
var
|
|
current_exit : Procedure;
|
|
current_exit : Procedure;
|
|
|
|
+ pstdout : ^Text;
|
|
{$if defined(MSWINDOWS) or defined(OS2)}
|
|
{$if defined(MSWINDOWS) or defined(OS2)}
|
|
i : longint;
|
|
i : longint;
|
|
{$endif}
|
|
{$endif}
|
|
@@ -688,18 +689,19 @@ Begin
|
|
{ Finalize units }
|
|
{ Finalize units }
|
|
FinalizeUnits;
|
|
FinalizeUnits;
|
|
{ Show runtime error and exit }
|
|
{ Show runtime error and exit }
|
|
|
|
+ pstdout:=@stdout;
|
|
If erroraddr<>nil Then
|
|
If erroraddr<>nil Then
|
|
Begin
|
|
Begin
|
|
- Writeln(stdout,'Runtime error ',Errorcode,' at $',hexstr(PtrInt(Erroraddr),sizeof(PtrInt)*2));
|
|
|
|
|
|
+ Writeln(pstdout^,'Runtime error ',Errorcode,' at $',hexstr(PtrInt(Erroraddr),sizeof(PtrInt)*2));
|
|
{ to get a nice symify }
|
|
{ to get a nice symify }
|
|
- Writeln(stdout,BackTraceStrFunc(Erroraddr));
|
|
|
|
- dump_stack(stdout,ErrorBase);
|
|
|
|
- Writeln(stdout,'');
|
|
|
|
|
|
+ Writeln(pstdout^,BackTraceStrFunc(Erroraddr));
|
|
|
|
+ dump_stack(pstdout^,ErrorBase);
|
|
|
|
+ Writeln(pstdout^,'');
|
|
End;
|
|
End;
|
|
{ Make sure that all output is written to the redirected file }
|
|
{ Make sure that all output is written to the redirected file }
|
|
Flush(Output);
|
|
Flush(Output);
|
|
Flush(ErrOutput);
|
|
Flush(ErrOutput);
|
|
- Flush(StdOut);
|
|
|
|
|
|
+ Flush(pstdout^);
|
|
Flush(StdErr);
|
|
Flush(StdErr);
|
|
{$if defined(MSWINDOWS) or defined(OS2)}
|
|
{$if defined(MSWINDOWS) or defined(OS2)}
|
|
{ finally release the heap if possible, especially
|
|
{ finally release the heap if possible, especially
|