Pin中有四个粒度级别:例程、指令和图像、跟踪。我可以指定一个限制/区域来开始和停止插入检测代码。可以通过类似指令(#start instrumentation,#end instrumentation)或类似的东西,
一个例子:
for( int i=0; i< x; i++)
{
#startInstrumentation
for( ....;.....;.....)
{
// some code
// function call, conditions , loops, ....
}
#endInstrumentation
}
有没有办法做到这一点?
这是什么意思:int (*b)[100]以及为了产生这个结果,这段代码的澄清是什么?
#include <iostream>
void foo(int a[100])
{
a [1]= 30 ;
std::cout<<a[1]<< std::endl;
}
void boo(int a[100])
{
std::cout<<a[1]<< std::endl;
}
int main()
{
int (*b)[100] = (int (*) [100]) malloc(100 * sizeof(int));
*b[1] = 20;
std::cout<< *b[1] << "\t" << b[1] << std::endl;
foo(*b);
boo(*b);
std::cout<< *b[1] << "\t" << b[1] << std::endl;
}
Run Code Online (Sandbox Code Playgroud)
以上代码输出:
20 0x44ba430
30
30
20 0x44ba430
Run Code Online (Sandbox Code Playgroud)