int main() {
BOOST_ASSERT(false);
...
}
Works flawlessly.
Attached is the debugger log for this program:
#include <cstdlib>
using namespace std;
void f() {
abort();
}
void g() {
f();
}
int main() {
g();
}
Interesting. This 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.