User forums > Using Code::Blocks

Boost assertions closes the debugger

<< < (3/10) > >>

ThundThund:
Well, the scenario is simple: I have one library, with many classes. In the method of one of the classes, I put BOOST_ASSERT(var). I link that library to my application, instance the class and then call the method. The debugger stops and I can't know what happened.


Note: Another thing I have to say is that breakpoints don't pause the debugger when I put them anywhere outside my "main.cpp file", don't know if it's related, maybe I'll post this in another thread.

zabzonk:
For me this code

#include <iostream>
#include <boost/assert.hpp>
using namespace std;


void f() {
  BOOST_ASSERT( 1 == 0 );
  // **** here ***
}

void g() {
   f();
}

int main()
{
   g();
   cout << "Hello world!" << endl;
   return 0;
}


When compiled with -g, and run in the debugger causes a break in the debugger. If I then go to the "Call Stack" debugger window and click on the the last entry there, I get the cursor moved to the line just after the BOOST_ASSERT. This is nowhere near as pretty as the MS debugger, I know, but we are talking gdb here!

This is with Win7, latest TDM, and a fairly recent CB nightly - SVN 7385.

ThundThund:
I've copied and pasted that code, and the debugger doesn't break for me, it stops at all. :(
I don't know what I'm doing wrong. I have the option "When stopping..." and the -g flag activated.

zabzonk:
Are you running in it in the debugger - i.e. from the Debug|Start menu option? And have you got the "Call Stack" window open? And if you don't get a break, what does  happen?

ThundThund:
Yes, Debug->Start. I've the Call stack window open. Imagine that you press the Stop debugging button at the moment the program starts, that happens, tha debugging finishes at the moment the assert is executed.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version