我正在尝试使用Eigen对象上的条件断点来调试GDB。例如,当向量中的任何值都非零时,我想要中断。我会在GDB中这样做:
break cpp/File.cpp:143 if (v != 0).any()
然而,这不起作用。GDB提供了以下功能:
Could not find operator!=
即使这是完全有效的语法。此外,像这样的条件断点
break cpp/File.cpp:143 if v[0] != 0
在GDB中显示以下错误:
Error in testing breakpoint condition: Couldn't get registers: No such process. An error occurred while in a function called from GDB. Evaluation of the expression containing the function