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).
这是场景。我正在调试我自己的应用程序(C / C ++),该应用程序正在使用公司另一个团队开发的一些库。当我的代码生成一些边缘情况时,断言失败。这是一个痛苦,因为断言没有正确配置,所以库函数工作正常,但我得到所有这些中断,我只需要继续(很多作为它在循环中)所以我可以得到我真正感兴趣的东西由于其他原因,我必须在调试时使用库的调试版本。另一个团队不会解决这个问题直到下一个版本(嘿,它适用于我们的机器)。
Can I tell the debugger to ignore the breakpoints asserted by this section of code (i.e. can it auto-continue for me).
我可以告诉调试器忽略这段代码断言的断点(即它可以为我自动继续)。
4 个解决方案
#1
3
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?.
如果代码自己触发断点(通过__debugbreak或int 3),则不能使用条件断点,因为Visual Studio根本不知道断点。但是,您可以通过修改调试器中的代码来禁用您不感兴趣的任何此类断点。可能不是你想要的,因为你需要在每个调试会话中重复这个,但是仍然可能比什么都好。有关更多信息,请参阅如何禁用程序断点/断言?
#2
2
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.
在调试库中自动忽略ASSERT()失败没有好办法。如果那是你必须使用的那个,你就必须说服其他团队现在解决这个问题,或者如果你有这个库的来源,你可以自己解决或删除断言只是为了让你的工作在此期间完成。
#3
2
You can add an exception handler around the call(s) to the library, catch the EXCEPTION_BREAKPOINT exception and do nothing.
您可以在对库的调用周围添加异常处理程序,捕获EXCEPTION_BREAKPOINT异常并且不执行任何操作。
Example 2 in the following link seems to be what you want to do:
以下链接中的示例2似乎是您要执行的操作:
http://msdn.microsoft.com/en-us/library/ms681409(VS.85).aspx
#4
0
You can use conditional breakpoints. Some links:
您可以使用条件断点。一些链接:
http://support.microsoft.com/kb/308469
http://dotnettipoftheday.org/tips/conditional_breakpoint.aspx
#1
3
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?.
如果代码自己触发断点(通过__debugbreak或int 3),则不能使用条件断点,因为Visual Studio根本不知道断点。但是,您可以通过修改调试器中的代码来禁用您不感兴趣的任何此类断点。可能不是你想要的,因为你需要在每个调试会话中重复这个,但是仍然可能比什么都好。有关更多信息,请参阅如何禁用程序断点/断言?
#2
2
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.
在调试库中自动忽略ASSERT()失败没有好办法。如果那是你必须使用的那个,你就必须说服其他团队现在解决这个问题,或者如果你有这个库的来源,你可以自己解决或删除断言只是为了让你的工作在此期间完成。
#3
2
You can add an exception handler around the call(s) to the library, catch the EXCEPTION_BREAKPOINT exception and do nothing.
您可以在对库的调用周围添加异常处理程序,捕获EXCEPTION_BREAKPOINT异常并且不执行任何操作。
Example 2 in the following link seems to be what you want to do:
以下链接中的示例2似乎是您要执行的操作:
http://msdn.microsoft.com/en-us/library/ms681409(VS.85).aspx
#4
0
You can use conditional breakpoints. Some links:
您可以使用条件断点。一些链接:
http://support.microsoft.com/kb/308469
http://dotnettipoftheday.org/tips/conditional_breakpoint.aspx