0
votes

I know that I can use components like madExcept, EurekaLog, JclDebug etc. to obtain stack traces. But how can I obtain stack traces without using such components?

2
What are "part components?"David Heffernan
"part components" is a exception logger(MadExcept, EurekaLog,JclDebug).loglong
Maybe it's time for Embarcadero to add a platform-independent wrapper class to the RTL to easily and universally get information about the call stack?Wouter van Nifterick
@loglong so you meant "3rd-party's components" and not "to part from someone". Sorry, but your English is even worse than mine. And that implies that you cannot be laconic and concise. So then write a lot, repeat every idea twice with totally different words (no any words repeated in ideal case), then maybe matching those phrases people would be able to reconstruct what you really meant.Arioch 'The

2 Answers

3
votes

The Windows API provides a function that will return stack traces. It is RtlCaptureStackBackTrace.

The will return code addresses rather than function names. If you want to display information like the third party components you mention, then you'll need to do more work. You need access to the information from the map file emitted by the Delphi linker.

2
votes

See d:\DelphiProjects\Libs\JCL\jcl\experts\repository\ExceptionDialog\StandardDialogs for the example implementation of this.