瀏覽代碼

* only print exception backtrace at end of unhandled exception in
tthread in case rtl is compiled with -dDEBUG_MT

git-svn-id: trunk@8595 -

Jonas Maebe 18 年之前
父節點
當前提交
4e78a30ee3
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      rtl/unix/tthread.inc

+ 4 - 0
rtl/unix/tthread.inc

@@ -85,7 +85,9 @@ end;
 function ThreadFunc(parameter: Pointer): ptrint;
 var
   LThread: TThread;
+{$ifdef DEBUG_MT}
   lErrorAddr, lErrorBase: Pointer;
+{$endif}
 begin
   WRITE_DEBUG('ThreadFunc is here...');
   LThread := TThread(parameter);
@@ -123,6 +125,7 @@ begin
   except
     on e: exception do begin
       LThread.FFatalException := TObject(AcquireExceptionObject);
+{$ifdef DEBUG_MT}
       lErrorAddr:=ExceptAddr;
       lErrorBase:=ExceptFrames^;
       writeln(stderr,'Exception caught in thread $',hexstr(LThread),
@@ -130,6 +133,7 @@ begin
       writeln(stderr,BackTraceStrFunc(lErrorAddr));
       dump_stack(stderr,lErrorBase);
       writeln(stderr);
+{$endif}
       // not sure if we should really do this...
       // but .Destroy was called, so why not try FreeOnTerminate?
       if e is EThreadDestroyCalled then LThread.FFreeOnTerminate := true;