loglong
loglong

Reputation: 23

How can I obtain a stack trace without using third party components?

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?

Upvotes: 0

Views: 474

Answers (2)

David Heffernan
David Heffernan

Reputation: 612934

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.

Upvotes: 3

Arioch 'The
Arioch 'The

Reputation: 16045

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

Upvotes: 2

Related Questions