Here’s a little example of it in use:
#include "CallStack.hpp"
#include <iostream>
using namespace std;
CallStackFrame mainFrame;
void CheckTestFunc() {
CallStack stack(mainFrame);
CallStackFrame frame = stack.GetStartFrame().Next();
long * args = (long *) frame.GetArgumentData();
long * vars = (long *) frame.GetVariableData();
void * ret = frame.GetReturnAddress();
cout << "TestFunc.arg=" << *args << endl;
cout << "TestFunc.a=" << *vars << endl;
}
void TestFunc(int arg) {
int a = 33;
CheckTestFunc();
}
int main() {
mainFrame = CallStack::CurrentFrame();
TestFunc(55);
return 0;
}
The output of this application will be:
TestFunc.arg=55 TestFunc.a=33
Original post


Sign In
Create Account



Back to top









