Re: [DynInst_API:] Iterating over instructions in bpatch basic blocks


Date: Mon, 02 Dec 2013 10:17:12 -0600
From: Bill Williams <bill@xxxxxxxxxxx>
Subject: Re: [DynInst_API:] Iterating over instructions in bpatch basic blocks
On 12/02/2013 09:43 AM, Wayne Motycka wrote:
I've built a method/function that intends to iterate over 2 BPatch_addressSpace
objects that I have opened from disk.  This works as expected when ran within
Eclipse but when I run it from the command line I get differing results coming
from accessing/iterating over a BPatch_basicBlock -> getInstructions()
collection/vector.  My method iterates over the first 4 instructions finding
the same in both addressSpaces (I'm using two copies of the same executable
so they should all agree) then I begin to see reported differences in the string
representation (format() method of Instruction) as well as the operands in the
instruction.

So, is this a known problem with the InstructionAPI, that you cannot rely on what
it parses?  I've  posted my method on pastebin as: http://pastebin.com/6UiJvhSh
if you want to see what/how I'm iterating over the instructions in the blocks.

This seems remarkably unlikely to be an instructionAPI problem. Much more likely that getProcedures or getAllBasicBlocks is returning something that's sorted by pointer and not by mutatee address (which could well be stable with a debug heap and not with a normal one)...if you're actually looking at the same bytes, you'll get the same instructions out.

For a sanity check, can you throw in the start address of each block/function and put up some sample output?

-Wayne


_______________________________________________
Dyninst-api mailing list
Dyninst-api@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api



--
--bw

Bill Williams
Paradyn Project
bill@xxxxxxxxxxx
[← Prev in Thread] Current Thread [Next in Thread→]