为什么watch中的结构体函数没有值?
有个越界检查工具,在检测出越界后,watch中的find_allocation(buf)有值,前面有个加号可以展开,但我在工程中没有找到调用它的函数,不知道它是怎么被调用的?有的工程可以读出值,有的复杂点的工程(多个c文件)就打不出来
#define CALL_STACK_SIZE 4
typedef struct _Allocation
{
void* ptr;
void* callers[CALL_STACK_SIZE];
} Allocation;
Allocation allocations[MAX_ALLOCS];
int last_alloc = -1;
Allocation* find_allocation(void* p)
{
DBGPRINTF("SSSSSSSSSSS");
for(int i = 0; i <= last_alloc; i++)
{
if(allocations[i].ptr == p)
return &allocations[i];
}
return NULL;
}