소스 검색

* dump stack when thread terminates because of exception (unix)

git-svn-id: trunk@8093 -
micha 18 년 전
부모
커밋
721ae51cd0
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      rtl/unix/tthread.inc

+ 7 - 1
rtl/unix/tthread.inc

@@ -104,8 +104,14 @@ begin
        end;
        end;
   except
   except
     on e: exception do begin
     on e: exception do begin
-      WRITE_DEBUG('got exception: ',e.message);
       LThread.FFatalException := TObject(AcquireExceptionObject);
       LThread.FFatalException := TObject(AcquireExceptionObject);
+      lErrorAddr:=ExceptAddr;
+      lErrorBase:=ExceptFrames^;
+      writeln(stderr,'Exception caught in thread $',hexstr(LThread),
+        ' at $',hexstr(lErrorAddr));
+      writeln(stderr,BackTraceStrFunc(lErrorAddr));
+      dump_stack(stderr,lErrorBase);
+      writeln(stderr);
       // not sure if we should really do this...
       // not sure if we should really do this...
       // but .Destroy was called, so why not try FreeOnTerminate?
       // but .Destroy was called, so why not try FreeOnTerminate?
       if e is EThreadDestroyCalled then LThread.FFreeOnTerminate := true;
       if e is EThreadDestroyCalled then LThread.FFreeOnTerminate := true;