Date: | Wed, 27 Jul 2016 10:56:48 +0200 |
---|---|
From: | Martijn <martijn@xxxxxxxxxxxxxxxxx> |
Subject: | [DynInst_API:] oneTimeCode in an exit callback not working |
Hello, I am trying to use proc->oneTimeCode inside an exit callback. The one time code adds a function call to finalize stuff in my instrumentation library.static void exitCallback(BPatch_thread* thread, BPatch_exitType) { ÂÂÂ BPatch_process* proc = thread->getProcess(); ÂÂÂ BPatch_image* image = proc->getImage(); ÂÂÂ std::vector<BPatch_snippet*> args; ÂÂÂ BPatch_constExpr stringArg("Exiting mutee"); ÂÂÂ args.push_back(&stringArg); ÂÂÂ std::vector<BPatch_function*> putsFuncs; ÂÂÂ image->findFunction("puts", putsFuncs); ÂÂÂ BPatch_funcCallExpr putsCall(*putsFuncs[0], args); ÂÂÂ proc->oneTimeCode(putsCall); ÂÂÂ proc->continueExecution(); } int main(int argc, char* argv[]) { ÂÂÂ BPatch_process* proc = bpatch.processCreate(argv[1], (const char**)(argv + 1)); ÂÂÂ bpatch.registerExitCallback(exitCallback); ÂÂÂ proc->continueExecution(); ÂÂÂ while(!proc->isTerminated()) ÂÂÂÂÂÂÂ bpatch.waitForStatusChange(); ÂÂÂ return EXIT_SUCCESS; } Cheers, ÂÂÂ MartijnAttachment:
onetimecode.tgz |
[← Prev in Thread] | Current Thread | [Next in Thread→] |
---|---|---|
|
Previous by Date: | Re: [DynInst_API:] Problems in instrumenting malloc, Martijn |
---|---|
Next by Date: | [DynInst_API:] [dyninst/dyninst] 1b9292: Started work on dataflowAPI based analysis for fin..., John Detter |
Previous by Thread: | [DynInst_API:] New tech report on binary code authorship, Barton Miller |
Next by Thread: | Re: [DynInst_API:] oneTimeCode in an exit callback not working, Josh Stone |
Indexes: | [Date] [Thread] |