Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you add conditional breaking based on another breakpoint being hit? Visual C++

I have a bunch of generic code that is used a lot, which i'd like to poke into in order to deal with a bug in a certain specific case.

So I'd like to break on a set of breakpoints only if some other breakpoint has been hit. Is there a way to do this in Visual 2005? I'm using C++ code.

Thanks!

like image 295
evilfred Avatar asked Dec 18 '22 08:12

evilfred


2 Answers

Please remember you can disable a breakpoint - it might be easier/more efficient/cleaner (then adding debug flags to your code and recompiling for example) to just disable the second breakpoint, wait till the first one breaks and then enable the second one in your breakpoints window - it takes just two mouse clicks each time you debug... :)

like image 110
RnR Avatar answered Feb 16 '23 00:02

RnR


If the trigger logic is complex enough, sometimes I find it easier to just add a DebugBreak(); call into the source.

like image 25
Jeff Youel Avatar answered Feb 15 '23 23:02

Jeff Youel