Re: [DynInst_API:] Inserting multiple snippets at an insertion point?


Date: Mon, 21 Jul 2014 15:06:28 -0500
From: Bill Williams <bill@xxxxxxxxxxx>
Subject: Re: [DynInst_API:] Inserting multiple snippets at an insertion point?
On 07/21/2014 01:15 PM, Wayne Motycka wrote:
Oh, I had forgot about the insertBefore and insertAfter flags, that is
probably what I'll need to use.

Thanks Bill.

As an aside, call/return edge instrumentation and pre/post call instrumentation (for particular callers) or entry/exit instrumentation (for all callers) *should* be entirely equivalent on x86, and should provide sane addresses in the instpoints. The only reason to use edge instrumentation is to correctly handle conditional calls/returns (or for modification, rather than instrumentation).

If you're working on PPC or with a cross-platform mutator, or there's some reason other than engineering ones to use edge instrumentation, then obviously, carry on.

-Wayne

On Mon, July 21, 2014 11:53 am, Bill Williams wrote:
On 07/21/2014 11:45 AM, Wayne Motycka wrote:

I've been trying to find ways to instrument the edges in the Dyninst
CFG
but instrumenting the back edge from a system library call, e.g. calling
  printf(), doesn't give insertion points that seem reasonable/valid
(the
insertion point addresses given by getExitPoints() and getAllPoints()
appears to be out of the local programs address ranges.)

It's possible (and if memory serves, it's likely) that when you're
inserting edge instrumentation, its instpoint address will be somewhere in
relocated code and will not correspond neatly to an original address.
(This is particularly true for call/return edges, as a particular
interprocedural edge doesn't live anywhere in the original binary.) We
*should* hand back NULL instpoints if they're really unusable.


So, I'm thinking of moving that edge instrumenting code block into the
edge that connects the calling block to the subsequent block along with
the instrumenting code for that connecting edge, effectively marking
that connecting edge as both the return path from the printf() system
call and the inter-block connecting edge (which is EdgeTypeEnum type of
"post-call
fallthrough")

This is also a reasonable approach, and call fallthrough edges exist for
this sort of simplification.

My question is if it is possible to insert two snippets referencing
calls to my edge marking library routine?

Yes, it's valid to insert multiple snippets at the same instrumentation
point; the "before/after" parameter to insertSnippet governs the relative
order of execution, if that's relevant to you.

Thanks,
Wayne Motycka
E2 Lab @ Univ. of Nebraska - Lincoln


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




--
--bw


Bill Williams
Paradyn Project
bill@xxxxxxxxxxx _______________________________________________
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→]