我想在函数参数上设置断点,如果它大于某个值.下面的虚拟代码:
int main(void)
{
uint64_t num = 123456;
uint64_t x = 847534;
uint64_t other = (num*x) - (x/num);
.... other stuff here (multithreaded stuff)
calc(other);
}
void calc(uint64_t size)
{
...do some stuff with size
}
Run Code Online (Sandbox Code Playgroud)
我试图通过以下方式设置断点:
(gdb) b calc if size == 852479
Run Code Online (Sandbox Code Playgroud)
但它不知道大小是什么,因为它是我猜的参数.如果参数等于某个数字,我将如何中断.打破对此函数的所有调用都不是一个选项,因为它在多线程环境中被调用了十亿次.