<<< Integer tree     Lambda Home    >>>

Common Text Transformation Library http://cttl.sourceforge.net/

Debugging and tracing


  1. Debugging example
  2. debugging_n_tracing.cpp
  3. CTTL_LAMBDA_ASSERT and CTTL_LAMBDA_TRACE
  4. lambda_assert.cpp

Macro Description
CTTL_TRACE_EVERYTHING
Turns on lambda tracing mode, unless CTTL_TRACE_DEPOSITS_OFF is also defined. Usage:
#define CTTL_TRACE_EVERYTHING
CTTL_TRACE_RULES
Turns on lambda tracing mode, unless CTTL_TRACE_DEPOSITS_OFF is also defined. Usage:
#define CTTL_TRACE_RULES
CTTL_TRACE_DEPOSITS
Turns on lambda tracing mode. Usage:
#define CTTL_TRACE_DEPOSITS
CTTL_TRACE_DEPOSITS_OFF
Turns lambda tracing mode off; used in combination with CTTL_TRACE_EVERYTHING and CTTL_TRACE_RULES macros. Usage:
#define CTTL_TRACE_DEPOSITS_OFF
CTTL_TRACE_DEPOSIT_JUSTIFY()
In tracing mode, justifies the CTTL_UNILOG_STREAM to align output with the current level of CTTL grammar tracing. If tracing mode is off, the macro has no effect on the execution. Usage:
CTTL_TRACE_DEPOSIT_JUSTIFY();
CTTL_TRACE_DEPOSIT_TEXT(expression)
where expression is a C++ expression (not a lambda expression.)
In tracing mode, sends result of expression to CTTL_UNILOG_STREAM. If tracing mode is off, has no effect on the execution. Usage:
CTTL_TRACE_DEPOSIT_TEXT( "text" );
CTTL_TRACE_DEPOSIT_TEXT( '\n' );
CTTL_TRACE_DEPOSIT_TEXT( 3.14 );
CTTL_LAMBDA_TRACE(message)
where message is a zero-terminated character string, char const*
This is in-line tracing macro for lambda expressions. CTTL_LAMBDA_TRACE is implemented as a literal translator:
( ++( scalar( 0 )^atoi^( message ) ) )
In tracing mode, CTTL_LAMBDA_TRACE returns the result of atoi(message). For example,
CTTL_LAMBDA_TRACE( "-123 abc" )
is legal atoi argument and returns minus 123 as the result.
If tracing mode is off, the macro has no effect on the execution and returns 1.
CTTL_LAMBDA_ASSERT(expression)
where expression is a lambda expression.
This is in-line assertion macro for lambda expressions. It tests logical lambda expression. If the result is false, the macro invokes standard C assert(). For example,
CTTL_LAMBDA_ASSERT( *dstack == scalar( 7.77 ) )

Debugging example



CTTL_LAMBDA_ASSERT and CTTL_LAMBDA_TRACE



Copyright © 1997-2009 Igor Kholodov mailto:cttl@users.sourceforge.net.

Permission to copy and distribute this document is granted provided this copyright notice appears in all copies. This document is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.


 

 

<<< Integer tree     Lambda Home    >>>