本文整理汇总了C++中PIN_Init函数的典型用法代码示例。如果您正苦于以下问题:C++ PIN_Init函数的具体用法?C++ PIN_Init怎么用?C++ PIN_Init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PIN_Init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
PIN_Init(argc, argv);
out.open(KnobOutput.Value().c_str());
INS_AddInstrumentFunction(InstrumentInstruction, 0);
// Fini prints the results.
PIN_AddFiniFunction(Fini, 0);
PIN_AddThreadStartFunction(CheckThreadCount, 0);
// Never returns
PIN_StartProgram();
return 0;
}
示例2: main
int main(int argc, char * argv[])
{
PIN_Init(argc, argv);
PIN_InitSymbols();
#if defined(TARGET_LINUX) || defined(TARGET_BSD)
LimitAvailableSpace();
#endif
out = fopen(KnobOutputFile.Value().c_str(), "w");
PIN_AddFiniFunction(Fini, 0);
// Never returns
PIN_StartProgram();
return 0;
}
示例3: main
int main(int argc, char * argv[])
{
// Initialize symbol processing
PIN_InitSymbols();
// Initialize pin
if (PIN_Init(argc, argv)) return Usage();
logging = ! KnobReplay.Value();
if (logging)
{
trace = fopen("record_imageload_rec.out", "w");
imgLog = fopen("imageload.log", "w");
IMG_AddInstrumentFunction(LogImageLoad, 0);
IMG_AddUnloadFunction (LogImageUnload, 0);
}
else
{ // Replaying
trace = fopen("record_imageload_play.out", "w");
imgLog = fopen("imageload.log", "r");
// We will handle image load operations.
PIN_SetReplayMode (REPLAY_MODE_IMAGEOPS);
// And then we replay the first two image load ops before we start the program.
// We do this even before adding the image instrumentation callback, that should still work,
// Pin should defer these and replay them inside PIN_StartProgram.
ReplayImageEntry();
ReplayImageEntry();
INS_AddInstrumentFunction (InstrumentInstruction, 0);
}
// These Trace functions demonstrate that the events are happening, they are the client...
IMG_AddInstrumentFunction(TraceImageLoad, 0);
IMG_AddUnloadFunction (TraceImageUnload, 0);
// Register Fini to be called when the application exits
PIN_AddFiniFunction(Fini, 0);
// Start the program, never returns
PIN_StartProgram();
return 0;
}
示例4: main
int main(INT32 argc, CHAR **argv)
{
PIN_InitLock(&Lock);
PIN_Init(argc, argv);
Out.open(KnobOutputFile.Value().c_str());
PIN_AddThreadStartFunction(ThreadStart, 0);
PIN_AddThreadFiniFunction(ThreadFini, 0);
INS_AddInstrumentFunction(Instruction, 0);
PIN_AddFiniFunction(Fini, 0);
// Never returns
PIN_StartProgram();
return 0;
}
示例5: main
int main(int argc, char *argv[])
{
PIN_InitSymbols();
if(PIN_Init(argc, argv)){
return Usage();
}
PIN_SetSyntaxIntel();
IMG_AddInstrumentFunction(Image, 0);
INS_AddInstrumentFunction(Instruction, 0);
#ifdef DEBUG
PIN_AddFiniFunction(Fini, 0);
#endif
PIN_StartProgram();
return 0;
}
示例6: main
int main(int argc, char * argv[])
{
// We accumlate counts into a register, make sure it is 64 bits to
// avoid overflow
ASSERTX(sizeof(ADDRINT) == sizeof(UINT64));
PIN_Init(argc, argv);
PIN_AddThreadStartFunction(ThreadStart, 0);
PIN_AddThreadFiniFunction(ThreadFini, 0);
PIN_AddFiniFunction(Fini, 0);
TRACE_AddInstrumentFunction(Trace, 0);
PIN_StartProgram();
return 0;
}
示例7: main
int main(int argc, char * argv[])
{
PIN_Init(argc, argv);
char *ld_preload = getenv("LD_PRELOAD");
if (ld_preload != 0)
{
printf("check_env_tool ERROR: LD_PRELOAD should not be a part of Pin environment");
exit(-1);
}
// Never returns
PIN_StartProgram();
return 0;
}
示例8: main
int main(int argc, char *argv[])
{
PIN_InitSymbols();
if( PIN_Init(argc,argv) )
{
return 1;
}
INS_AddInstrumentFunction(InstrumentInstruction, 0);
IMG_AddInstrumentFunction(Image, 0);
PIN_AddFiniFunction(Fini, 0);
// Never returns
PIN_StartProgram();
return 0;
}
示例9: main
int main(int argc, char *argv[])
{
if (PIN_Init(argc, argv)) return Usage();
trace = fopen("strace.out", "w");
INS_AddInstrumentFunction(Instruction, 0);
PIN_AddSyscallEntryFunction(SyscallEntry, 0);
PIN_AddSyscallExitFunction(SyscallExit, 0);
PIN_AddFiniFunction(Fini, 0);
// Never returns
PIN_StartProgram();
return 0;
}
示例10: main
int
main(int argc, char** argv)
{
if (PIN_Init(argc, argv))
{
usage();
return 1;
}
align_check.Activate();
// Never returns
PIN_StartProgram();
// NOTREACHED
return 0;
}
示例11: main
// argc, argv are the entire command line, including pin -t <toolname> -- ...
int main(int argc, char * argv[])
{
// Initialize pin
PIN_Init(argc, argv);
// Register InstrumentTrace function
TRACE_AddInstrumentFunction(InstrumentTrace, 0);
// Register application exit call back
PIN_AddFiniFunction(Fini, 0);
// Start the program, never returns
PIN_StartProgram();
return 0;
}
示例12: main
int main(int argc, char *argv[])
{
PIN_Init(argc, argv);
PIN_InitSymbols();
IMG_AddInstrumentFunction(ImageLoad, 0);
TRACE_AddInstrumentFunction(Trace, 0);
PIN_AddFiniFunction(Fini, 0);
// Never returns
PIN_StartProgram();
return 0;
}
示例13: main
int main(int argc, char * argv[])
{
PIN_Init(argc, argv);
Out.open(KnobOutfile.Value().c_str());
if (!Out.good())
{
std::cerr << "Unable to open '" << KnobOutfile.Value() << "'" << std::endl;
return 1;
}
INS_AddInstrumentFunction(InstrumentIndirects, 0);
PIN_AddFiniFunction(Fini, 0);
PIN_StartProgram();
return 0;
}
示例14: main
int main(INT32 argc, CHAR **argv)
{
InitLock(&lock);
out = fopen("thread_count.out", "w");
PIN_Init(argc, argv);
PIN_AddThreadStartFunction(ThreadStart, 0);
PIN_AddThreadFiniFunction(ThreadFini, 0);
PIN_AddFiniFunction(Fini, 0);
// Never returns
PIN_StartProgram();
return 0;
}
示例15: main
int main(int argc, char * argv[])
{
if (PIN_Init(argc, argv)) return Usage();
// Create a Profiler Object
Profiler *prof = new Profiler();
// Passing profiler object to the instrumentation function
INS_AddInstrumentFunction(Instruction, prof);
// Passing profiler object to the finish function
PIN_AddFiniFunction(Fini, prof);
PIN_StartProgram();
return 0;
}