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?
Asked
Active
Viewed 390 times
0
-
1What are "part components?" – David Heffernan Jul 04 '13 at 08:57
-
"part components" is a exception logger(MadExcept, EurekaLog,JclDebug). – loglong Jul 05 '13 at 02:26
-
1Maybe 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 Jul 05 '13 at 09:32
-
@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 Jul 05 '13 at 09:52
2 Answers
3
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.

David Heffernan
- 601,492
- 42
- 1,072
- 1,490
2
See d:\DelphiProjects\Libs\JCL\jcl\experts\repository\ExceptionDialog\StandardDialogs for the example implementation of this.

Arioch 'The
- 15,799
- 35
- 62
-
sorry,my question title have a mistake. “delphi get stack trace runtime without using jclDEBUG” is my corrective question title. – loglong Jul 05 '13 at 02:52
-
@loglong then the answer is "by implementing those components yourself; and to learn how to do it the best way would be - "Use the Source, Luke" - to read their sources in parallel MSDN. But if you would learn from their sources just to write your own - then what's the point ?" Google about "NYH syndrome" – Arioch 'The Jul 05 '13 at 09:49