Re: [DynInst_API:] Examples for constructing instrumentation code snippets


Date: Sat, 26 Sep 2015 01:03:26 +0000
From: Mohamed Elsabagh <melsabag@xxxxxxx>
Subject: Re: [DynInst_API:] Examples for constructing instrumentation code snippets
Was this question ever answered? Would you please share/repost the answer, if any? In addition, is there a way to use an InstructionAPI::_expression_ in a BPatch_snippet without manually building the snippet(s) from the _expression_?Â

Thanks,
Mohamed

On Mon, Aug 24, 2015 at 8:09 PM Shuai Wang <wangshuai901@xxxxxxxxx> wrote:
Dear list,


I am trying to insert some code like this to the beginning of every basic block:

  push %eax
  lahf
  inc 0x7000000
  sahf
  pop %eax

I suppose I need to construct each instruction into some BPatch_* class instance (such as BPatch_arithExpr). However, after searching into DynInst's document, I still don't knowÂ
how to represent those instructions into BPatch_* class. I can only find three class's definition, BPatch_constExpr, BPatch_FuncCallExpr and BPatch_arithExpr and related example code.

Could anyone give me some guide on how to define BPatch_* instances associated with my instrumentation code sequence? Or which document should I refer to?Â

Sincerely,
Shuai
_______________________________________________
Dyninst-api mailing list
Dyninst-api@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api
[← Prev in Thread] Current Thread [Next in Thread→]