Reputation: 103467
Using Delphi 7, how can I get a string representing the stack-trace from an Exception
?
try
SomethingDodgy();
except
on E:Exception do begin
// print stack trace
Log.Write(/* ??? */);
end;
end;
I hear there's a GetStackTrace function in the latest delphi, but I can't find anything for delphi 7. No, upgrading is not an option :)
Upvotes: 10
Views: 4677
Reputation: 24088
The stack-trace in Win32 is not as good as .NET's or Java's (and the latest versoin of Delphi uses .NET stack trace).
Anyway, I found one link that provides more information on it here (It is at ExeEx so to allow to view that solution click the first link on the search).
See the bottom of the page there.
Upvotes: -1
Reputation: 36840
MemChk is pretty easy to use (especially to search/find memory leaks) and knows how to render a stack trace from a code address.
Upvotes: 1