I'm using VSC on a Mac to work on a C++ project running on a Linux VM using gcc & gdb. Everything works great, but I can't get conditional breakpoints to work. If I set a breakpoint, execution will stop there every time. But if I make the breakpoint conditional on an expression, execution never steps.
The VSC debugging instructions don't provide an example, so maybe I'm entering the conditions incorrectly.
The expression I want is something like:
((int)strcmp(my_struct->str, "Hello, world!") == 0) && (time == 400)
I've tried it with a semicolon at the end. I've also tried making the expression 1
, 1;
, true
, and true;
to no avail.
When I set a hit-count condition, execution stops the next time the breakpoint is reached, so that doesn't seem to work as expected, either.
My code uses OpenMP. Not sure if that matters.