Boost logo

Boost :

Subject: Re: [boost] [BOOST_ASSERT] any one against improving debug support?
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2009-06-19 08:37:59


Peter Dimov skrev:
> Thorsten Ottosen:
>> Hi,
>>
>> The current difinition of BOOST_ASSERT is a pain to use with the
>> debugger and Boost.Test because it doesn't trigger a break-point.
>>
>> Does anyone object to defining it like this in <boost/assert.hpp>
>>
>> #if (BOOST_MSVC >= 1400)
>> #include <crtdbg.h>
>> #define BOOST_ASSERT _ASSERTE
>> #endif
>
> I'm not sure I understand. BOOST_ASSERT is just assert by default,
> right?

Right.

>assert does trigger a breakpoint by default, right?

Right. Here's visual C++ definition:

#define assert(_Expression) (void)( (!!(_Expression)) ||
(_wassert(_CRT_WIDE(#_Expression), _CRT_WIDE(__FILE__), __LINE__), 0) )

> Boost.Test
> intentionally disables the assert breakpoint by default so that it can
> fail the test case and not require human intervention, right? What am I
> missing?

The break-point inserted by _ASSERT and _ASSERTE really causes the
debugger to stop no matter what (via a asm { int 3; } instruction.
The run from outside the debugger continues to run the test-cases.

I've atatched by current defintion of <boost/assert.hpp>.

Any objections to moving it to trunk?

-Thorsten




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk