Breakpoint in ROS_ASSERT
Is it possible to set a debug breakpoint in ROS_ASSERT (gdb, Eclipse..) which only stops the program execution if the assertion fails so I can inspect the stack when the assertion fails?
It would work, if it would be like this:
if ( !( cond ) )
{
ROS_ASSERT( cond ); // set breakpoint here
}
But without the surrounding if statement, the ROS_ASSERT is only in one line, and if I set a breakpoint there it will stop always, not only if the assertion fails.....
Any ideas on this? Thank you!
ROS_ASSERT calls abort(). You might be able to trap that directly.
+1 Works! Thank you!