Browse Source

* Moved WriteExceptionToStdErr to system unit, so it is observed even in absence of sysutils (bug ID 27708)

git-svn-id: trunk@30551 -
michael 10 years ago
parent
commit
94e57aa463
3 changed files with 7 additions and 2 deletions
  1. 4 1
      rtl/inc/system.inc
  2. 3 0
      rtl/inc/systemh.inc
  3. 0 1
      rtl/objpas/sysutils/sysutilh.inc

+ 4 - 1
rtl/inc/system.inc

@@ -993,7 +993,10 @@ Begin
     redirection to seriell i/o }
 {$ifndef EMBEDDED}
   { Show runtime error and exit }
-  pstdout:=@stdout;
+  if WriteExceptionToStdErr then
+    pstdout:=@stderr
+  else  
+    pstdout:=@stdout;
   If erroraddr<>nil Then
    Begin
      Writeln(pstdout^,'Runtime error ',Errorcode,' at $',hexstr(erroraddr));

+ 3 - 0
rtl/inc/systemh.inc

@@ -752,6 +752,9 @@ Var
   { Stack checking }
   StackBottom : Pointer;
   StackLength : SizeUInt;
+  
+Var
+  WriteExceptionToStdErr : Boolean = True;
 
 function StackTop: Pointer;
 

+ 0 - 1
rtl/objpas/sysutils/sysutilh.inc

@@ -255,7 +255,6 @@ type
 
 Var
    OnShowException : Procedure (Msg : ShortString);
-   WriteExceptionToStdErr : Boolean = True;
    
 Const
    HexDisplayPrefix : string = '$';