示例:
class test_gdb
{
public:
void testFun(void)
{
cout << "this is test function"<<endl;
}
};
int main(void)
{
test_gdb testObj;
testObj.testFun();
}在这里,如果我想在testFun中保留一个中断点,我该怎么做呢?我尝试过使用break testFun,但它不起作用。
发布于 2019-03-29 22:20:07
我该怎么做呢
以下几种方式:
(gdb) break test_gdb::testFun在所有testFun上设置断点,无论它们是在哪个类中定义的:
(gdb) rbreak testFun如果您有多个具有不同签名(不同参数类型)的testFun,则可以使用GDB制表符完成来选择一个
(gdb) break 'test_gdb::testFun<TAB> # GDB will complete or offer multiple choicehttps://stackoverflow.com/questions/55413394
复制相似问题