User forums > Using Code::Blocks
Boost assertions closes the debugger
ThundThund:
That seems to be what I want to get :)
EDIT: See image in previous page.
zabzonk:
I have just tried this with the latest debugger nightly, on Windows 7, and even simple stuff like this (no Boost):
assert( 1 == 0 );
or the even simpler:
abort();
is not being caught in the debugger.
OTOH, stuff like this;
int * p = 0;
* p = 42;
is caught, and the correct stack-frame and location is displayed. Using this fact, one can write this fix/hack:
#define BOOST_ENABLE_ASSERT_HANDLER
#include <boost/assert.hpp>
using namespace std;
namespace boost
{
void assertion_failed(char const * expr, char const * function, char const * file, long line) {
*(int *)0 = 42;
}
}
void f() {
BOOST_ASSERT( 1 == 0 );
}
void g() {
f();
}
int main() {
g();
}
which will give you the call stack for assert that failed.
oBFusCATed:
Neil please use code tags!
OK, so abort detection is not working on windows and this is a bug.
Can you provide the full debugger's debug log?
See the debugger options how to enable this log.
ThundThund:
Do you mean this?
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.8
Child process PID: 2732
Program exited with code 03.
Debugger finished with status 0
oBFusCATed:
No, this is the normal log, the debugger's debug log is not visible by default and should be explicitly enabled.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version