Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to walk the call stack?

Posted on 1997-04-12
2
Medium Priority
?
302 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 400 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

926 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