1

I'm using Delphi 5. I want to get in code, all the calling procedure's call stack. For example:

procedure main (line 17) > function F1 (line 34) > function F2 (line 2)

MadExcept does exactly that, but only when it handles an exception. I want to get it when I'm asking. I need it for a log.

Is there a way to get that infomation, by MadExcept, or by another way?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • What doesn't work with function StackTrace from madStackTrace.pas? Of course you need to parse the result and construct the format you desire. – Uwe Raabe Feb 09 '22 at 08:45
  • 1
    with EurekaLog you can do it. See [get the call stack from eurekalog at any time](https://stackoverflow.com/questions/31305666/get-the-call-stack-from-eurekalog-at-any-time) – Diego Muñoz Feb 09 '22 at 08:54
  • 1
    You can do this from madExcept, just search or ask on the forum – David Heffernan Feb 09 '22 at 09:02
  • 1
    [Call Stack](http://forum.madshi.net/viewtopic.php?f=4&t=28705) and [Get stack trace quickly](http://forum.madshi.net/viewtopic.php?f=4&t=28259) and [Get StackTrace for Exception](http://forum.madshi.net/viewtopic.php?f=4&t=28374) sound promising. – AmigoJack Feb 09 '22 at 18:10

1 Answers1

-2

What I remember from my old Delphi 5 days is that MemCheck also is able to read the call stack from within a procedure call. It may require to set very specific compiler and linker options in the project properties.

Stijn Sanders
  • 35,982
  • 11
  • 45
  • 67