This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: How to display assertions by diag_printf ?
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Riadh Elloumi <riadh dot elloumi at parrot dot fr>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Tue, 14 Mar 2006 11:13:19 +0100
- Subject: Re: [ECOS] How to display assertions by diag_printf ?
- References: <4415BBAD.3050002@parrot.fr>
On Mon, Mar 13, 2006 at 07:36:29PM +0100, Riadh Elloumi wrote:
> Hi all,
>
> Looking at the assert.h, I see that there are many ways to display the
> assertion fails in eCos, the compiled one for me is:
>
> #if defined(CYGINT_ISO_STDIO_FORMATTED_IO) && defined(CYGINT_ISO_EXIT)
>
> # include <stdio.h>
> # include <stdlib.h>
>
> # define assert( __bool ) \
> do { \
> if (0 == (__bool)) { \
> fprintf( stderr, "User assertion failed: \"%s\", at %s:%d\n", \
> #__bool, __FILE__, __LINE__); \
> abort(); \
> } \
> } while(0)
>
>
> Both CYGINT_ISO_STDIO_FORMATTED_IO and CYGINT_ISO_EXIT are defined.
> Compliancy is a good thing, but the fprintf fails as well with an
> assertion fail, and I have a result like this:
>
> UseASSERT FAIL: <4>_exit.cxx[83]void _exit() Program _exiting with
> non-zero error status
>
> How can I disable this assertion mode to see clearly what assert has
> failed? The latter mode is ok for me (with diag_printf).
Enable:
CYGDBG_INFRA_DEBUG_TRACE_ASSERT_SIMPLE
and disable
CYGDBG_INFRA_DEBUG_TRACE_ASSERT_BUFFER
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss