I am working with a C++ codebase that does not use exceptions, and the convention is that every function returns false on failure, such that a significant portion of the code looks like this:
bool compute_something(int& result) {
bool ok = step1();
ok = ok && step2();
ok = ok && step3();
...
ok = ok && stepN(result);
return ok;
}
When debugging an error, I would like to add a breakpoint whenever any variable named "ok" in the program becomes false, in order to find the exact moment the error occured.
I found this question, which is somewhat similar, but does not solve this problem (and it is gdb specific).
Can this be achieved in visual studio? Or any other environment for that matter, the answer might help someone else.