I want to use Dyninst to trace the runtime stack. I was thinking doing a call out to an instrumentation function at each function entry which would accept the dereferenced rsp value (which will be the return address at the function entry) as an argument and log it within this instrumentation function which I load from a shared library. I am not quite sure how to get the dereferenced register value and do the function call using it as an argument. I see Bpatch_registerExpr but I am not sure how to initialize with the dereferenced rsp register value. Can somebody give me a pointer on how to do this? Or is there a better of doing it?
Thanks