exip  Alpha 0.5.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
How to debug

Turning the debugging is done by setting EXIP_DEBUG to ON.

You have control over the level of verbosity (INFO, WARNING or ERROR) and the source of debugging information. All these parameters can be configured in the exipConfig.h header that is defined per target platform in build/gcc/[target platform]. When turned on, the debugging information is by default printed on the standard output.

Debug configuration

The following macro definitions are used to customize the debugging:

EXIP_DEBUG
Switch ON/OFF the debugging
DEBUG_CHAR_OUTPUT(ch)
Defines a function to print a single character ch
DEBUG_OUTPUT(str)
Defines a function to print a NULL terminated string str
EXIP_DEBUG_LEVEL
Verbosity level: one of INFO, WARNING or ERROR
DEBUG_MSG(level, module, msg)
Used to print a debug message

Error codes

Most of the functions in the exip library return a 8 bit integer that indicates the status of the execution with 0 being success and non-zero value indication an error condition.

The error codes are defined in errorHandle.h

Debug output

DEBUG_STREAM_IO provides a detailed stream output and position debug messages. It shows byte-level output on a new line, beginning with '>>'. It indicates position of next write in the form @B:b, where B is the byte offset and b is the bit offset within the byte.

Below is an example encoding for the EXI equivalent of "<description>new</description>". First, you see the local name for each production in the rule. Below the rule, the ">> 0x0 (3 bits)" tells exactly what was written to select the 'description' production at index 0. Then the "@8:4" shows the position at which the next output occurs. Just above the output below was "@8:1", where the present output was placed.
To see this sort of output, use DEBUG_STREAM_IO and DEBUG_CONTENT_IO.
 >RULE
 NT-1:
    SE (qname: 4:34)    NT-2    0   description
    SE (qname: 4:75)    NT-3    1   notes
    SE (qname: 4:3)     NT-4    2   activateAt
    SE (qname: 4:44)    NT-5    3   expireAt
    SE (qname: 4:80)    NT-6    4   panId
    SE (qname: 4:111)   NT-7    5   timezoneId
    SE (qname: 4:33)    NT-8    6   deploymentDevices
    EE      7
 >> 0x0 (3 bits)  @8:4
 >Start string data serialization
 >RULE
 NT-0:
    CH [2]  NT-1    0
    AT (qname 2:1) [1]  NT-0    1.0
 >> 0x0 (1 bits)  @8:5
 >> 0x05  @8:6  @9:5
  Write string, len 3: new
 >> 0x6E  @9:6  @10:5
 >> 0x65  @10:6  @11:5
 >> 0x77  @11:6  @12:5
 >End element serialization