获取call stack的几种方法

madExcept 有个方法叫StackTrace (在单元 madStackTrace)可以提取

JEDI Code Library 也有类似的东西,在unit JclDebug.

 Exceptional Magic也不错,代码如下:

try raise Exception.Create('Something bad happened...'); except on e: Exception do begin CallStack := TStringList.Create; try ExceptionHook.LogException; // Logs call stack ExceptionHook.CallStack.Dump(CallStack); ShowMessage(CallStack.Text); finally CallStack.Free; end; end; end;

 

你可能感兴趣的:(delphi基础相关)