OpenClovis Logo

Files | Classes | Macros | Typedefs | Functions
API Reference Pages
Debug Service

Defines, Structures, Typedefs, Functions. More...

Files

file  clDebugApi.h
 Header file of Debug Service Related APIs.
file  clDebugErrors.h
 Header file of Debug Error Codes.

Classes

struct  ClDebugFuncEntryT
 The structure contains the entry for the debug CLI information that needs the component has to provide on a per command basis. More...
struct  ClDebugModEntryT
 This structure is used to register the module with the CLI library. More...

Macros

#define CL_ASSERT(expr)   do { if (clDbgPauseOnCodeError&&(!(expr))) clDbgCodeError(0,("Assertion failed")); else assert((expr)); } while(0)
 This macro is used to assert upon a critical failure.
#define CL_DBG_ERR_CMD_NOT_FOUND   0x100
 Debug Library error.
#define CL_DBG_ERR_COMMON_ERROR   0x104
 Loglevel set failed.
#define CL_DBG_ERR_INVALID_CTX   0x102
 Debug command ignored.
#define CL_DBG_ERR_INVALID_PARAM   0x103
 Invalid time out.
#define CL_DBG_ERR_UNRECOGNIZED_CMD   0x101
 Debug unrecognized command.
#define CL_DEBUG
 The macro CL_DEBUG_PRINT is used to print messages to the user.
#define CL_DEBUG_COMP_NAME_LEN   128
 The maximum length of the name of a component in the debug CLI.
#define CL_DEBUG_COMP_PROMPT_LEN   15
 The maximum length of the prompt for the component to be displayed in the debug CLI.
#define CL_DEBUG_CRITICAL   3
 These defines are aligned with the logging defined in clLogApi.h and will ultimately be deprecated as logs are converted over to the new format.
#define CL_DEBUG_ERROR   4
 This debug level in CL_DEBUG_PRINT is used to report a non-critical error.
#define CL_DEBUG_FUNC_HELP_LEN   201
 The maximum length of the help for a command of the component in the debug CLI.
#define CL_DEBUG_FUNC_NAME_LEN   41
 The maximum length of a command of the component in the debug CLI.
#define CL_DEBUG_INFO   7
 This debug level in CL_DEBUG_PRINT is used to provide information.
#define CL_DEBUG_LEVEL_THRESHOLD   CL_DEBUG_ERROR
 The value of CL_DEBUG_LEVEL_THRESHOLD can be changed (either here, or by some file that includes this file) to make the debug output either more or less voluminous.
#define CL_DEBUG_RC(ERROR_CODE)   CL_RC(CL_CID_DEBUG, (ERROR_CODE))
 DEBUG Specific Error Codes.
#define CL_DEBUG_TRACE   0xc
 This debug level in CL_DEBUG_PRINT is used to add trace information.
#define CL_DEBUG_WARN   5
 This debug level in CL_DEBUG_PRINT is used to report a warning.
#define CL_FUNC_ENTER()
 This macro is called while entering the function.
#define CL_FUNC_EXIT()
 This macro is called while exiting the function.

Typedefs

typedef ClRcT(* ClDebugCallbackT )(ClUint32T argc, ClCharT **argv, ClCharT **ret)
 This is the signature of the callback invoked by the debug CLI in response to a command entered.
typedef struct ClDebugFuncEntryT ClDebugFuncEntryT
 The structure contains the entry for the debug CLI information that needs the component has to provide on a per command basis.
typedef struct ClDebugModEntryT ClDebugModEntryT
 This structure is used to register the module with the CLI library.
typedef ClPtrT ClDebugPrintHandleT
 The type of the handle clDebugPrint APIs.

Functions

ClRcT clDebugCli (CL_IN ClCharT *nprompt)
 Invokes the library based local debug CLI.
ClRcT clDebugDeregister (CL_IN ClHandleT hReg)
 De-registers the debug CLI information from the EO.
ClRcT clDebugLibFinalize (void)
 Finalizes the Debug CLI library.
ClRcT clDebugLibInitialize (void)
 Initializes the Debug CLI library.
ClRcT clDebugPrint (CL_INOUT ClDebugPrintHandleT msg, CL_IN const char *fmtStr,...) CL_PRINTF_FORMAT(2
 Prints a string into the handle.
ClRcT clDebugPrintDestroy (CL_INOUT ClDebugPrintHandleT *msg)
 Frees the print handle.
ClRcT ClRcT clDebugPrintFinalize (CL_IN ClDebugPrintHandleT *msg, CL_OUT char **buf)
 Cleans up the print handle.
ClRcT clDebugPrintInitialize (CL_OUT ClDebugPrintHandleT *msg)
 Retrieve a handle for printing.
ClRcT clDebugPromptSet (CL_IN const ClCharT *pCompPrompt)
 Sets the name and prompt of the component.
ClRcT clDebugRegister (CL_IN ClDebugFuncEntryT *funcArray, CL_IN ClUint32T funcArrayLen, CL_OUT ClHandleT *phDebugReg)
 Registers the component name.
ClRcT clDebugVersionCheck (CL_INOUT ClVersionT *pVersion)
 Check the given version is supported or not.

Detailed Description

Defines, Structures, Typedefs, Functions.

Macro Definition Documentation

#define CL_DEBUG

The macro CL_DEBUG_PRINT is used to print messages to the user.

It logs other useful information about the print such as file, function number and line number from where the message originated. It is also used to log messages in kernel mode.

#define CL_DEBUG_CRITICAL   3

These defines are aligned with the logging defined in clLogApi.h and will ultimately be deprecated as logs are converted over to the new format.

This debug level in CL_DEBUG_PRINT is used to report a critical error.

Typedef Documentation

typedef ClRcT(* ClDebugCallbackT)(ClUint32T argc,ClCharT **argv,ClCharT **ret)

This is the signature of the callback invoked by the debug CLI in response to a command entered.

A function of this signature has to be registered by the component with the debug CLI for every command.

Function Documentation

ClRcT clDebugCli ( CL_IN ClCharT *  nprompt)

Invokes the library based local debug CLI.

Header File:
clDebugApi.h
Parameters
npromptString which is incorporated into the debug CLI prompt.
Return values
CL_OKThe API executed successfully.
Description:
This function is used to invoke the library based local debug CLI. It will continue to execute till exited from the console. This function must be called from a separate thread.
Library File:
libClDebugClient.a
See Also
clDebugLibInitialize(), clDebugLibFinalize()
ClRcT clDebugDeregister ( CL_IN ClHandleT  hReg)

De-registers the debug CLI information from the EO.

Header File:
clDebugApi.h
Parameters
hRegHandle for the commandGroup which has to deregistered. This handle is returned by clDebugRegister.
Return values
CL_OKThe API executed successfully.
CL_ERR_INVALID_HANDLEOn passing an invalid Handle.
Description:
This function is used to de-register the debug CLI information from a given EO.
Library File:
libClDebugClient.a
See Also
clDebugRegister()
ClRcT clDebugLibFinalize ( void  )

Finalizes the Debug CLI library.

Header File:
clDebugApi.h
Parameters:
None.
Return values
CL_OKThe API executed successfully. And return values passed by EO APIs on an error.
Description:
This function is used as the library finalization routine for debug CLI. It is the last function called in order to do the necessary cleanup.
Library File:
libClDebugClient.a
See Also
clDebugLibInitialize()
ClRcT clDebugLibInitialize ( void  )

Initializes the Debug CLI library.

Header File:
clDebugApi.h
Parameters:
None.
Return values
CL_OKThe API executed successfully.
CL_ERR_NO_MEMORYOn failure to allocate memory.
Description:
This function is used as the library initialization routine for debug CLI. It must be called before executing any other debug functions.
Library File:
libClDebugClient.a
See Also
clDebugLibFinalize()
ClRcT clDebugPrint ( CL_INOUT ClDebugPrintHandleT  msg,
CL_IN const char *  fmtStr,
  ... 
)

Prints a string into the handle.

Header File:
clDebugApi.h
Parameters
msgHandle for printing.
fmtStrFormat string for the variadic arguments.
vargsVariadic arguments.
Return values
CL_OKThe API executed successfully.
Description:
This function is used to print a string with a maximum of 512 bytes into the handle at any given point in time time. This function can be invoked 'n' number of times after invoking clDebugPrintInitialize function, before calling either clDebugPrintFinalize or clDebugPrintDestroy functions.
Library File:
libClDebugClient.a
See Also
clDebugPrintInitialize(), clDebugPrintFinalize()
ClRcT clDebugPrintDestroy ( CL_INOUT ClDebugPrintHandleT msg)

Frees the print handle.

Header File:
clDebugApi.h
Parameters
msgHandle for printing.
bufBuffer containing the print message.
Return values
CL_OKThe API executed successfully. It returns all error codes returned by clBufferDelete().
Description:
This function is used to free the handle without returning any message buffer.
Library File:
libClDebugClient.a
See Also
clDebugPrintInitialize()
ClRcT ClRcT clDebugPrintFinalize ( CL_IN ClDebugPrintHandleT msg,
CL_OUT char **  buf 
)

Cleans up the print handle.

Header File:
clDebugApi.h
Parameters
msgHandle for printing.
bufBuffer containing the print message.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_NO_MEMORYOn failure to allocate memory.
Description:
This function is used to clean up the print handle. It returns a memory allocated buffer containing the print messages logged into the handle.
Library File:
libClDebugClient.a
See Also
clDebugPrintInitialize()
ClRcT clDebugPrintInitialize ( CL_OUT ClDebugPrintHandleT msg)

Retrieve a handle for printing.

Header File:
clDebugApi.h
Parameters
msgHandle for printing.
Return values
CL_OKThe API executed successfully.
CL_ERR_NO_MEMORYOn failure to allocate memory. And other errors returned by EO APIs.
Description:
This function is used to retrieve a handle for printing.
Library File:
libClDebugClient.a
See Also
clDebugPrintFinalize(), clDebugPrint()
ClRcT clDebugPromptSet ( CL_IN const ClCharT *  pCompPrompt)

Sets the name and prompt of the component.

Header File:
clDebugApi.h
Parameters
pCompPromptPrompt for the component.
Return values
CL_OKThe API executed successfully.
CL_ERR_INVALID_PARAMETEROn passing an invalid parameter.
CL_ERR_NULL_PARAMETEROn passing NULL as parameter.
Description:
This function is used to set the prompt for the Component. If the user doesn't set any prompt, the default prompt will be displayed. The default prompt is "DEFAULT".
Library File:
libClDebugClient.a
Related Function(s):
None
ClRcT clDebugRegister ( CL_IN ClDebugFuncEntryT funcArray,
CL_IN ClUint32T  funcArrayLen,
CL_OUT ClHandleT *  phDebugReg 
)

Registers the component name.

Parameters
funcArrayList of commands and their respective functions and help.
funcArrayLenLength of the function array.
phDebugRegThis is address where handle for registration will be returned.
Return values
CL_OKThe API executed successfully.
CL_ERR_INVALID_PARAMETEROn passing an invalid parameter.
CL_ERR_NO_MEMORYOn failure to allocate memory.
CL_ERR_DUPLICATEWhen you register same command more than once.
Description:
This function is used to register the list of all the CLI functions for the component with the EO. It is invoked before the debug server CLI can be used. The server debug CLI uses information registered by this function. If you register the same command again, DUPLICATE error will be returned.
See Also
clDebugDeregister()
ClRcT clDebugVersionCheck ( CL_INOUT ClVersionT pVersion)

Check the given version is supported or not.

Header File:
clDebugApi.h
Parameters
pVersionthe version.
Return values
CL_OKThe API executed successfully. It returns all error codes returned by clVersionVerify().
Description:
This function is used to check the given version is compatible or not. If not, will return the compatibl version with error.
Library File:
libClDebugClient.a
See Also
clDebugLibInitialize(), clDebugLibFinalize()

Generated on Tue Jan 10 10:29:15 PST 2012 for OpenClovis SDK using Doxygen