Hello,
I am trying to limit the instructions that need to be instrumented
based on information from SymtabAPI. Using SymtabAPI, I have the
VariableLocation information like:
stClass: storageRegOffset, refClass: storageNoRef, mr_reg:
x86_64::rsp, frame_offset: fffffffffff159d8, low-pc: 0x4004f4,
high-pc: 0x4004f5
Using the BPatch interface, I have the Expression::Ptr objects for
instructions that read/write memory.
How can I make sure that I instrument only those instructions for
which the operand address matches the VariableLocation? Is it
something that can be checked only a runtime? For instance, the
DynInstAPI Programmer's Guide shows a way to print effective address
of all load and store instructions. Will I (similarly) have to
instrument all load/store instructions and check whether the
instrumented address matches the VariableLocation? I fear that that
will substantially increase the overhead.
If there is any documentation on handling addresses where I can learn
how to make Expression::Ptr work with the SymtabAPI, please let me
know. Thanks very much!
Ashay
|