Problem using '__asm int 3;' to issue breakpoint
Posted: 08 Dec 2009, 21:30
Hi everyone,
I am trying to use an old trick of mine to catch a bug while running my chess engine under WinBoard 4.4.0. In the past, I have often put the following line of code in a debug build of a C++ program running under Windows, and it triggers a breakpoint on that line that allows me to bring up the debugger (Microsoft Visual Studio):
I also tried this, to no avail...
Either of these works great if I run my chess engine directly in a command prompt, but when hosted inside WinBoard, the above line of code just causes my engine to hang and stop responding. When I close WinBoard after that, the dialog box I was expecting all along suddenly appears and just as quickly vanishes. It is like WinBoard is somehow suppressing the debugger interrupt.
All I am trying to do is trap a very rare special case with a breakpoint so I can see the stack trace if/when it happens. It would be fine however I do it, so long as I can run it under WinBoard and not have to type in the correct sequence of WinBoard protocol commands manually.
Any advice would be greatly appreciated. Thanks in advance!
- Don
I am trying to use an old trick of mine to catch a bug while running my chess engine under WinBoard 4.4.0. In the past, I have often put the following line of code in a debug build of a C++ program running under Windows, and it triggers a breakpoint on that line that allows me to bring up the debugger (Microsoft Visual Studio):
- Code: Select all
__asm int 3;
I also tried this, to no avail...
- Code: Select all
#include <assert.h>
// ... blah blah blah
assert(false);
Either of these works great if I run my chess engine directly in a command prompt, but when hosted inside WinBoard, the above line of code just causes my engine to hang and stop responding. When I close WinBoard after that, the dialog box I was expecting all along suddenly appears and just as quickly vanishes. It is like WinBoard is somehow suppressing the debugger interrupt.
All I am trying to do is trap a very rare special case with a breakpoint so I can see the stack trace if/when it happens. It would be fine however I do it, so long as I can run it under WinBoard and not have to type in the correct sequence of WinBoard protocol commands manually.
Any advice would be greatly appreciated. Thanks in advance!
- Don