Free Pascal: call stack and procedures names at runtime
Here is an example how to get N-2 calling procedure information.
Warning: code seeking debugging info is slow so be aware to use it in loops.
Make sure to compile with following options:
-gl
(not requierd but show file and line numbers info)-gs
(show proc name after address)
var …