It's been several years since I tried doing 1st-party stackwalks from an
instrumented mutatee and things may have changed. But the last time I did
this you could add a call to
BPatch::setInstrStackFrames(true);
before you insert instrumentation. This would cause Dyninst to generate
stack frames around generated instrumentation. That adds runtime
overhead, but also gives a stack walker sufficient information to walk out
of the instrumentation.
I believe there's also efforts underway to have Dyninst start updating
existing DWARF stack unwinding information as it instruments and relocates
code. But I'm not sure where those efforts stand or when they'd appear in
a released Dyninst. Someone from the Dyninst team would have to comment.
-Matt
On Wed, 28 Aug 2013, Marc Brünink wrote:
Dear all,
short version:
What is the appropriate way to walk the stack in a mutatee?
long version:
StackwalkerAPI implements basic stack walking. Some code in Dyninst
implements the additional tweaks necessary to handle the complexity added by
instrumentation. Thus, we can still perform a third party stackwalk of
instrumented code.
But how do I perform a first party stackwalk in the mutatee? The problem is
that only the mutator knows about all this additional Dyninst features, e.g.
which code got relocated, etc.
I suppose this is a very common problem. However, at the moment I fail to
find a nice, clean, and easy way to walk the stack in the mutatee.
Before I dive into this in more detail, let me ask a simple question:
Is there an obvious way to walk the stack in the mutatee which I just don't
know about? Or do I have to manually make sure the FrameSteppers etc. in my
mutatee are up-to-date?
Marc
_______________________________________________
Dyninst-api mailing list
Dyninst-api@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api
|