views:

432

answers:

4

Aaargh!

OK, here's the scenario. I'm debugging my own app (C/C++) which is using some library developed by another team in the company. An assertion fails when my code generates some edge case. Its a pain because the assertion is not formulated correctly so the library function is working OK but I get all these interruptions where I just have to continue (lots as its in a loop) so I can get to the stuff I'm actually interested in. I have to use the debug version of the library when debugging for other reasons. The other team wont fix this till next release (hey, it works on our machine).

Can I tell the debugger to ignore the breakpoints asserted by this section of code (i.e. can it auto-continue for me).

A: 

You can use conditional breakpoints. Some links:

http://support.microsoft.com/kb/308469
http://dotnettipoftheday.org/tips/conditional_breakpoint.aspx

Slavo
Its not a breakpoint, its a failed assertion. The debugger just stops and pops up a dialog with options to actually break or continue.
Tim Ring
+3  A: 

If the code is triggering breakpoints on its own (by __debugbreak or int 3), you cannot use conditional breakpoints, as the breakpoints are not know to Visual Studio at all. However, you may be able to disable any such breakpoints you are not interested in by modifying the code from the debugger. Probably not what you want, because you need to repeat this in each debugging session, however still may be better than nothing. For more information read How to disable a programmatical breakpoint / assert?.

Suma
Yep, it generating an INT 3, I'll see if can I pop in a NOP at that point to get it to stop interrupting me...
Tim Ring
+2  A: 

There's no good way to automatically ignore ASSERT() failures in a debug library. If that's the one you have to use, you're just going to have to convince the other team that this needs fixed now, or if you have the source for this library, you could fix or remove the assertions yourself just to get your work done in the meantime.

HitScan
+2  A: 

You can add an exception handler around the call(s) to the library, catch the EXCEPTION_BREAKPOINT exception and do nothing.

Example 2 in the following link seems to be what you want to do:

http://msdn.microsoft.com/en-us/library/ms681409(VS.85).aspx

TheJuice
Thanks, I'll give it a try.........
Tim Ring