Advertisement
RandomClear

How to get call stack on demand

Jan 30th, 2013
560
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.76 KB | None | 0 0
  1. // See also: http://pastebin.com/46QkwZNi - "how to convert call stack to text"
  2. // See also: http://pastebin.com/36yMX1Mf - "how to get call stack for last exception"
  3. // See also: http://pastebin.com/ACtr0r6S - "how to silently log exception"
  4. // See also: http://pastebin.com/sBn3PA1r - "how to create hang/deadlock report on demand"
  5.  
  6. uses
  7.   ECallStack,
  8.   EClasses,
  9.   EDebugInfo;
  10.  
  11. procedure TForm1.Button1Click(Sender: TObject);
  12. var
  13.   CallStack: TEurekaBaseStackList;
  14. begin
  15.   CallStack := GetCurrentCallStack;
  16.   // You can also use other functions from ECallStack unit
  17.   try
  18.     Memo1.Lines.Text := CallStack.ToString;
  19.     // You can also use CallStackToString(s) routines to customize textual formatting
  20.   finally
  21.     FreeAndNil(CallStack);
  22.   end;
  23. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement