Author Topic: Boost assertions closes the debugger  (Read 25455 times)

zabzonk

  • Guest
Re: Boost assertions closes the debugger
« Reply #45 on: November 03, 2011, 08:33:43 pm »
> BTW there are no signals on windows, as far as I know.

http://msdn.microsoft.com/en-us/library/xdkz3x12%28v=vs.71%29.aspx

Despite what the "Visual Studio .NET 2003" header implies, the text makes it clear that signals have always been a part of Windows.

Offline ThundThund

  • Multiple posting newcomer
  • *
  • Posts: 21
Re: Boost assertions closes the debugger
« Reply #46 on: November 04, 2011, 09:14:57 am »
What about this?

http://stackoverflow.com/questions/1721543/continue-to-debug-after-failed-assertion-on-linux-c-c

They use SIGTRAP or Int 3.
I'm now at work, I'll try to use it this afternoon.

zabzonk

  • Guest
Re: Boost assertions closes the debugger
« Reply #47 on: November 04, 2011, 09:47:10 am »
Interesting. This code:

Code
#include <iostream>
using namespace std;

void f() {
   asm( "int $3" );
}

void g() {
f();
}

int main() {
cout << "hello world\n";
g();
cout << "hello again\n";
}

Does indeed cause a  break in the debugger and displays the correct stack frames.  It also allows continuation after the interrupt. Windows does not support SIGTRAP, so you would be limited to using the non-portable asm(). You would also have to modify the BOOST_ASSERT code too.
« Last Edit: November 04, 2011, 10:02:11 am by Neil Butterworth »