Unable to get vscode to stop at a conditional breakpoint in a C++ debug

Viewed 21

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.

I want the program to stop at the loop when i == 2. The expression I tried but didn't work:

(i == 2)

Moreover, 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.

0 Answers
Related