Reputation: 21
In VSCode how can I set a conditional breakpoint like v.compare("2") == 0
using the graphical interface? I use this with C/C++ IntelliSense, debugging, and code browsing but the breakpoint does not work. (It always breaks regardless of the conditional value.)
Adding the same breakpoint directly into GDB works:
(gdb) condition 1 v.compare("2") == 0
(gdb) i b
Num Type Disp Enb Address What
1 breakpoint keep y 0x000000000000166e in tttt(std::__cxx11::basic_string<char,std::char_traits<char>, std::allocator<char> > const&, bool)
at /home/butiaev/project/experience/vecxsdeq/project/executable/vecxsdeq.cpp:53
stop only if v.compare("2") == 0
(gdb)
Upvotes: 1
Views: 1407
Reputation: 3420
Assuming you have setup gdb
as a debugging back-end in VSCode:
Edit breakpoint
and you will be able to specify an expression, select number of hits or transform the breakpoint into a tracepoint.Upvotes: 1