Solved

How to walk the call stack?

Posted on 1997-04-12
2
289 Views
Last Modified: 2010-04-06
I want to be able to generate within a procedure the call stack that got us there. Knowing the logical addresses of the callers on the stack will do -- I don't need (yet) to get the procedure names or such like.
0
Comment
Question by:RobMarsh
2 Comments
 
LVL 3

Accepted Solution

by:
mheacock earned 200 total points
ID: 1335371
You could use ASM directive and the SP register.  I believe
the SP register points to the top of the stack, therefore you
could work your way back through it.
0
 

Author Comment

by:RobMarsh
ID: 1335372
I worked something out myself through brute force and ignorance rather than insight. the function below called from within a procedure gives you the address of the caller of the procedure in a form that works with the IDE's Search|Find Error utility.

function GetCaller: pointer;
asm
  MOV  EAX, , [EBP+8]
  SUB   EAX,, 4
end;

Thanks,
RobMarsh
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question