I'm trying to debug with GDB using conditional breakpoints on an Eigen object. For instance, I'd like to break when any values in my vector are nonzero. I would do this in GDB:
break cpp/File.cpp:143 if (v != 0).any()
However, this doesn't work. GDB gives this:
Could not find operator!=
even though this is perfectly valid syntax. Moreover, a conditional breakpoint like
break cpp/File.cpp:143 if v[0] != 0
gives this error in 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
(Eigen::DenseCoeffsBase<Eigen::Array<int, 3, 1, 0, 3, 1>, 1>::operator[](long)) will be abandoned.
When the function is done executing, GDB will silently stop.
The code was compiled with -O0 -g -fno-inline
. How do I debug the contents of an Eigen object?