[klee-dev] obtain distance to a particular instruction

Nowack, Martin m.nowack at imperial.ac.uk
Wed Aug 28 12:28:44 BST 2019


Hi Qiao,

Currently, there is no direct support for this.
But, to hack it - under the assumption you don’t need the coverage-guided searcher - you can modify the `StatsTracker::computeReachableUncovered` function (https://github.com/klee/klee/blob/8a531bf8f276274b146dbb245293b06d31dfaef4/lib/Core/StatsTracker.cpp#L805).

You can update the `sm.setIndexedValue(…)` and replace `isa<ReturnInst>(inst)` (https://github.com/klee/klee/blob/8a531bf8f276274b146dbb245293b06d31dfaef4/lib/Core/StatsTracker.cpp#L875) with the check for your target instruction. Still, this will used for distance calculation for all states.

Hope that helps,

Martin

On 10. Aug 2019, at 04:44, Qiao Kang <qiaokang1213 at gmail.com<mailto:qiaokang1213 at gmail.com>> wrote:

Hi,

If I understand correctly, KLEE can use MinDistToUncovered as a weight to prioritize execution state which is closet to an uncovered instruction. What if I want to prioritize the state which is closet to a particular instruction (say, the instruction at line X), instead of an uncovered one?

One way in my mind is to obtain the distance between the state and the target instruction. Is there such an API in KLEE that can help compute this dist?

Thanks,
Qiao
_______________________________________________
klee-dev mailing list
klee-dev at imperial.ac.uk<mailto:klee-dev at imperial.ac.uk>
https://mailman.ic.ac.uk/mailman/listinfo/klee-dev

-------------- next part --------------
HTML attachment scrubbed and removed


More information about the klee-dev mailing list