The UIAErr module defines standard error events that allow
tooling to identify common errors in a consistent way. They are all
intended to be used with the Log_writeX APIs and, in the future, with
crash dump APIs, and provide a way to log errors in a more standardized
way than the generic Log_error API enables.
The events in this module have one of the following event priority levels:
EMERGENCY: used to indicate a non-recoverable situation (e.g. a crash, with
the event containing information about the cause of the crash)
CRITICAL: used to indicate a sever error that should raise an alarm or
cause a notification message to be sent to a system administrator.
ERROR: used to indicate a recoverable error that does not require an alarm
to be raised.
The following special formatting specifiers may be used to define the
msg field of the UIAErr events:
%$S - a string parameter that can provide additional formatting specifiers
Note that $S use in strings passed in as a paramter is not supported.
%$F - a specifier for a string parameter containing the file name (__FILE__) and
an integer parameter containing the line number (__LINE__).
The following configuration script demonstrates how to enable use of
UIAErr events within an application. Since the Diags.STATUS bits are set
to ALWAYS_ON by default, no explicit code is required to enable the
Diags Masks for these events.
| config UIAErr_critical // module-wide |
|
critical error event code
VALUES
(%x) integer that identifies the type of error
DETAILS
Used to log a critical error in which the system
has e.g. had to kill certain operations in order to
keep running. (Event Level = CRITICAL)
EXAMPLE
The following C code shows how to log a fatal error code as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Int myCriticalErrorCode = 0xACODE;
...
Log_write1(UIAErr_critical,myCriticalErrorCode);
...
"CRITICAL ERROR: ErrorCode:0xACODE."
SEE
| config UIAErr_criticalWithStr // module-wide |
|
critical error event code and fmt string
extern const Log_Event UIAErr_criticalWithStr;
VALUES
(%x) integer that identifies the type of error
(%$S) fmt string used to format the event message.
Up to 6 additional arguments can be logged with this event if
required. The formatting string should provide format specifiers
for each of the additional arguments
DETAILS
Used to log a critical error in which the system
has e.g. had to kill certain operations in order to
keep running. (Event Level = CRITICAL)
EXAMPLE
The following C code shows how to log a legacy error code and an
associated string as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Int myCriticalErrorCode = 0xAC0DE;
...
Log_write2(UIAErr_criticalWithStr,myCriticalErrorCode,(IArg)"My description of critical error 0xAC0DE");
...
"CRITICAL ERROR: ErrorCode:0xAC0DE. My description of critical error 0xAC0DE"
SEE
| config UIAErr_divisionByZero // module-wide |
|
divisionByZero event code
extern const Log_Event UIAErr_divisionByZero;
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that divide by zero exception occurred.
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_divisionByZero,(IArg)__FILE__,__LINE__);
...
"ERROR: Division by zero at demo.c line 1234."
| config UIAErr_entryPointNotFound // module-wide |
|
entryPointNotFound event code
extern const Log_Event UIAErr_entryPointNotFound;
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that a module or DLL entry point was not found
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_entryPointNotFound,(IArg)__FILE__,__LINE__);
...
"ERROR: Entry Point Not Found at demo.c line 1234."
| config UIAErr_error // module-wide |
|
Event to use to log an existing software Error Code
VALUES
(%x) integer that identifies the type of error
DETAILS
UIAErr_error is used primarily to support logging of legacy error codes with minimal
overhead. Metadata is generated for this event that provides a predefined format
specifier string that can be used to display the error code with. This minimizes the
number of parameters that need to be logged with the event (it only requires the
actual error code to be logged). Unlike the Log_error API, no __FILE__ or
__LINE__ information about the call-site is logged with the error code.
EXAMPLE
The following C code shows how to log a legacy error code as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Int myErrorCode = 0xEC0DE;
Log_write1(UIAErr_error,myErrorCode);
...
"ERROR: ErrorCode:0xECODE"
SEE
| config UIAErr_errorWithStr // module-wide |
|
Event to use to log an existing software Error Code and fmt string
VALUES
(%x) integer that identifies the type of error
(%$S) fmt string used to format the event message.
Up to 6 additional arguments can be logged with this event if
required. The formatting string should provide format specifiers
for each of the additional arguments
DETAILS
UIAErr_errorWithStr is used primarily to support logging of legacy error codes along
with user-defined strings that describe the error. Unlike the Log_error API,
no __FILE__ or __LINE__ information about the call-site is logged with the error code.
EXAMPLE
The following C code shows how to log a legacy error code as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Int myErrorCode = 0xEC0DE;
String myErrorStr = "Legacy Error String for error 0xECODE";
...
Log_write2(UIAErr_errorWithStr,myErrorCode,(IArg)myErrorStr);
...
"ERROR: ErrorCode:0xECODE. Legacy Error String for error 0xECODE"
SEE
| config UIAErr_exception // module-wide |
|
exception event code
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that an exception occurred.
Typically used with LogSnapshot or LogCrashDump APIs to
log stack dump data that identifies why the exception occurred.
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_exception,(IArg)__FILE__,__LINE__);
...
"ERROR: Exception at demo.c line 1234."
SEE
| config UIAErr_fatal // module-wide |
|
fatal error code
VALUES
(%x) integer that identifies the type of error
DETAILS
Used to log a fatal, nonrecoverable error (Event level = EMERGENCY)
EXAMPLE
The following C code shows how to log a fatal error code as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Int myFatalErrorCode = 0xDEADC0DE;
...
Log_write1(UIAErr_fatal,myFatalErrorCode);
...
"FATAL ERROR: ErrorCode:0xDEADC0DE."
SEE
| config UIAErr_fatalWithStr // module-wide |
|
fatal error event code and fmt string
VALUES
(%x) integer that identifies the type of error
(%$S) fmt string used to format the event message.
Up to 6 additional arguments can be logged with this event if
required. The formatting string should provide format specifiers
for each of the additional arguments
DETAILS
Used to log a fatal, nonrecoverable error.
EXAMPLE
The following C code shows how to log a legacy error code and an
associated string as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Int myFatalErrorCode = 0xDEADC0DE;
String myFatalErrorStr = "My description of fatal error 0xDEADC0DE";
...
Log_write2(UIAErr_fatalWithStr,myFatalErrorCode,(IArg)myFatalErrorStr);
...
"FATAL ERROR: ErrorCode:0xDEADC0DE. My description of fatal error 0xDEADC0DE"
SEE
| config UIAErr_floatingPointError // module-wide |
|
floatingPointError event code
extern const Log_Event UIAErr_floatingPointError;
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that a floating point error occurred
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_floatingPointError,(IArg)__FILE__,__LINE__);
...
"ERROR: Floating Point Error at demo.c line 1234."
| config UIAErr_hwError // module-wide |
|
hardware error event code
VALUES
(%x) integer that identifies the type of warning
DETAILS
Used to log a generic hardware error.
Unlike the Log_error API, no __FILE__ or __LINE__ information about
the call-site is logged with the error code.
EXAMPLE
The following C code shows how to log a legacy error code as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Int myHWErrorCode = 0xEC0DE;
...
Log_write1(UIAErr_hwError,myHWErrorCode);
...
"HW ERROR: ErrorCode:0xECODE."
SEE
| config UIAErr_hwErrorWithStr // module-wide |
|
hardware error event code and fmt string
extern const Log_Event UIAErr_hwErrorWithStr;
VALUES
(%x) integer that identifies the type of error
(%$S) fmt string used to format the event message.
Up to 6 additional arguments can be logged with this event if
required. The formatting string should provide format specifiers
for each of the additional arguments
DETAILS
Used to log a generic hardware error.
EXAMPLE
The following C code shows how to log a legacy error code and an
associated string as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Int myHWErrorCode = 0xEC0DE;
String myHWErrorStr = "My description of hardware error 0xEC0DE";
...
Log_write2(UIAErr_hwErrorWithStr,myHWErrorCode,(IArg)myHWErrorStr);
...
"HW ERROR: ErrorCode:0xECODE. My description of hardware error 0xEC0DE"
SEE
| config UIAErr_illegalInstruction // module-wide |
|
illegalInstruction event code
extern const Log_Event UIAErr_illegalInstruction;
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that an illegal instruction was executed
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_illegalInstruction,(IArg)__FILE__,__LINE__);
...
"ERROR: Illegal Instruction executed at demo.c line 1234."
| config UIAErr_indexOutOfRange // module-wide |
|
indexOutOfRange event code
extern const Log_Event UIAErr_indexOutOfRange;
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
index
The index value that was out of range
DETAILS
Used to log that an index out of range condition occurred.
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write3(UIAErr_indexOutOfRange,(IArg)__FILE__,__LINE__,badIndex);
...
"ERROR: OIndex out of range at demo.c line 1234. [INDEX]0xFFFFFFFF"
| config UIAErr_invalidParameter // module-wide |
|
invalidParameter event code
extern const Log_Event UIAErr_invalidParameter;
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
paramNum
The parameter number in the function's signature that was invalid
paramValue
The invalid parameter value
DETAILS
Used to log that an invalid parameter was detected
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Void myFunc(Int caseNumber){
switch(caseNumber){
...
break;
default :
Log_write4(UIAErr_floatingPointError,(IArg)__FILE__,__LINE__,1,caseNumber);
}
}
"ERROR: Invalid Parameter at demo.c line 1234. [ParamNum]1 [ParamValue]0xFFFFFFFF"
| config UIAErr_memoryAccessFault // module-wide |
|
memoryAccessFault event code
extern const Log_Event UIAErr_memoryAccessFault;
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
adrs
The address that caused the memory access fault
DETAILS
Used to log that a memory access fault occurred.
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write3(UIAErr_memoryAccessFault,(IArg)__FILE__,__LINE__,(IArg)badAdrs);
...
"ERROR: Memory Access Fault at demo.c line 1234. [ADRS]0xFFFFFFFF"
| config UIAErr_moduleNotFound // module-wide |
|
moduleNotFound event code
extern const Log_Event UIAErr_moduleNotFound;
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
moduleId
The Module ID of the module that was not found
DETAILS
Used to log that a module was not found
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write3(UIAErr_moduleNotFound,(IArg)__FILE__,__LINE__,moduleIdThatWasNotFound);
...
"ERROR: Module not found at demo.c line 1234. [MODULE_ID]0x32903"
| config UIAErr_notImplemented // module-wide |
|
notImplemented event code
extern const Log_Event UIAErr_notImplemented;
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that an attempt to access a feature that is not implemented
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_notImplemented,(IArg)__FILE__,__LINE__);
...
"ERROR: Attempt to access feature that is not implemented at demo.c line 1234."
| config UIAErr_nullPointerException // module-wide |
|
nullPointerException event code
extern const Log_Event UIAErr_nullPointerException;
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that a null pointer exception occurred.
Typically used with LogSnapshot or LogCrashDump APIs to
log stack dump data that identifies why the exception occurred.
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_nullPointerException,(IArg)__FILE__,__LINE__);
...
"ERROR: Null Pointer Exception at demo.c line 1234."
| config UIAErr_overflowException // module-wide |
|
overflowException event code
extern const Log_Event UIAErr_overflowException;
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that an overflow exception occurred.
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_overflowException,(IArg)__FILE__,__LINE__);
...
"ERROR: Overflow exception at demo.c line 1234."
| config UIAErr_securityException // module-wide |
|
securityException event code
extern const Log_Event UIAErr_securityException;
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that a security exception occurred.
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_securityException,(IArg)__FILE__,__LINE__);
...
"ERROR: Security Exception at demo.c line 1234."
| config UIAErr_stackOverflow // module-wide |
|
stackOverflow event code
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that a stack overflow was detected. (Event Level = CRITICAL)
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_stackOverflow,(IArg)__FILE__,__LINE__);
...
"ERROR: Stack Overflow detected at demo.c line 1234."
| config UIAErr_uncaughtException // module-wide |
|
uncaughtException event code
extern const Log_Event UIAErr_uncaughtException;
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that an uncaught exception occurred.
Typically used with LogSnapshot or LogCrashDump APIs to
log stack dump data that identifies why the exception occurred.
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_uncaughtException,(IArg)__FILE__,__LINE__);
...
"ERROR: Uncaught Exception at demo.c line 1234."
| config UIAErr_unexpectedInterrupt // module-wide |
|
unexpectedInterrupt event code
extern const Log_Event UIAErr_unexpectedInterrupt;
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that an unexpected interrupt occurred.
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_unexpectedInterrupt,(IArg)__FILE__,__LINE__);
...
"ERROR: Null Pointer Exception at demo.c line 1234."
| Module-Wide Built-Ins |
|
// Get this module's unique id
Bool UIAErr_Module_startupDone();
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool UIAErr_Module_hasMask();
// Test whether this module has a diagnostics mask
Bits16 UIAErr_Module_getMask();
// Returns the diagnostics mask for this module
Void UIAErr_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
| config UIAErr.critical // module-wide |
|
critical error event code
msg: "CRITICAL ERROR: ErrorCode:0x%x"
};
VALUES
(%x) integer that identifies the type of error
DETAILS
Used to log a critical error in which the system
has e.g. had to kill certain operations in order to
keep running. (Event Level = CRITICAL)
EXAMPLE
The following C code shows how to log a fatal error code as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Int myCriticalErrorCode = 0xACODE;
...
Log_write1(UIAErr_critical,myCriticalErrorCode);
...
"CRITICAL ERROR: ErrorCode:0xACODE."
SEE
C SYNOPSIS
| config UIAErr.criticalWithStr // module-wide |
|
critical error event code and fmt string
msg: "CRITICAL ERROR: ErrorCode:0x%x. %$S"
};
VALUES
(%x) integer that identifies the type of error
(%$S) fmt string used to format the event message.
Up to 6 additional arguments can be logged with this event if
required. The formatting string should provide format specifiers
for each of the additional arguments
DETAILS
Used to log a critical error in which the system
has e.g. had to kill certain operations in order to
keep running. (Event Level = CRITICAL)
EXAMPLE
The following C code shows how to log a legacy error code and an
associated string as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Int myCriticalErrorCode = 0xAC0DE;
...
Log_write2(UIAErr_criticalWithStr,myCriticalErrorCode,(IArg)"My description of critical error 0xAC0DE");
...
"CRITICAL ERROR: ErrorCode:0xAC0DE. My description of critical error 0xAC0DE"
SEE
C SYNOPSIS
| config UIAErr.divisionByZero // module-wide |
|
divisionByZero event code
msg: "ERROR: Division by zero at %$F."
};
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that divide by zero exception occurred.
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_divisionByZero,(IArg)__FILE__,__LINE__);
...
"ERROR: Division by zero at demo.c line 1234."
C SYNOPSIS
| config UIAErr.entryPointNotFound // module-wide |
|
entryPointNotFound event code
msg: "ERROR: Entry Point Not Found at %$F."
};
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that a module or DLL entry point was not found
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_entryPointNotFound,(IArg)__FILE__,__LINE__);
...
"ERROR: Entry Point Not Found at demo.c line 1234."
C SYNOPSIS
| config UIAErr.error // module-wide |
|
Event to use to log an existing software Error Code
msg: "ERROR: ErrorCode:0x%x"
};
VALUES
(%x) integer that identifies the type of error
DETAILS
UIAErr_error is used primarily to support logging of legacy error codes with minimal
overhead. Metadata is generated for this event that provides a predefined format
specifier string that can be used to display the error code with. This minimizes the
number of parameters that need to be logged with the event (it only requires the
actual error code to be logged). Unlike the Log_error API, no __FILE__ or
__LINE__ information about the call-site is logged with the error code.
EXAMPLE
The following C code shows how to log a legacy error code as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Int myErrorCode = 0xEC0DE;
Log_write1(UIAErr_error,myErrorCode);
...
"ERROR: ErrorCode:0xECODE"
SEE
C SYNOPSIS
| config UIAErr.errorWithStr // module-wide |
|
Event to use to log an existing software Error Code and fmt string
msg: "ERROR: ErrorCode:0x%x. %$S"
};
VALUES
(%x) integer that identifies the type of error
(%$S) fmt string used to format the event message.
Up to 6 additional arguments can be logged with this event if
required. The formatting string should provide format specifiers
for each of the additional arguments
DETAILS
UIAErr_errorWithStr is used primarily to support logging of legacy error codes along
with user-defined strings that describe the error. Unlike the Log_error API,
no __FILE__ or __LINE__ information about the call-site is logged with the error code.
EXAMPLE
The following C code shows how to log a legacy error code as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Int myErrorCode = 0xEC0DE;
String myErrorStr = "Legacy Error String for error 0xECODE";
...
Log_write2(UIAErr_errorWithStr,myErrorCode,(IArg)myErrorStr);
...
"ERROR: ErrorCode:0xECODE. Legacy Error String for error 0xECODE"
SEE
C SYNOPSIS
| config UIAErr.exception // module-wide |
|
exception event code
msg: "ERROR: Exception at %$F."
};
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that an exception occurred.
Typically used with LogSnapshot or LogCrashDump APIs to
log stack dump data that identifies why the exception occurred.
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_exception,(IArg)__FILE__,__LINE__);
...
"ERROR: Exception at demo.c line 1234."
SEE
C SYNOPSIS
| config UIAErr.fatal // module-wide |
|
fatal error code
msg: "FATAL ERROR: ErrorCode:0x%x"
};
VALUES
(%x) integer that identifies the type of error
DETAILS
Used to log a fatal, nonrecoverable error (Event level = EMERGENCY)
EXAMPLE
The following C code shows how to log a fatal error code as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Int myFatalErrorCode = 0xDEADC0DE;
...
Log_write1(UIAErr_fatal,myFatalErrorCode);
...
"FATAL ERROR: ErrorCode:0xDEADC0DE."
SEE
C SYNOPSIS
| config UIAErr.fatalWithStr // module-wide |
|
fatal error event code and fmt string
msg: "FATAL ERROR: ErrorCode:0x%x. %$S"
};
VALUES
(%x) integer that identifies the type of error
(%$S) fmt string used to format the event message.
Up to 6 additional arguments can be logged with this event if
required. The formatting string should provide format specifiers
for each of the additional arguments
DETAILS
Used to log a fatal, nonrecoverable error.
EXAMPLE
The following C code shows how to log a legacy error code and an
associated string as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Int myFatalErrorCode = 0xDEADC0DE;
String myFatalErrorStr = "My description of fatal error 0xDEADC0DE";
...
Log_write2(UIAErr_fatalWithStr,myFatalErrorCode,(IArg)myFatalErrorStr);
...
"FATAL ERROR: ErrorCode:0xDEADC0DE. My description of fatal error 0xDEADC0DE"
SEE
C SYNOPSIS
| config UIAErr.floatingPointError // module-wide |
|
floatingPointError event code
msg: "ERROR: Floating Point Error at %$F."
};
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that a floating point error occurred
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_floatingPointError,(IArg)__FILE__,__LINE__);
...
"ERROR: Floating Point Error at demo.c line 1234."
C SYNOPSIS
| config UIAErr.hwError // module-wide |
|
hardware error event code
msg: "HW ERROR: ErrorCode:0x%x"
};
VALUES
(%x) integer that identifies the type of warning
DETAILS
Used to log a generic hardware error.
Unlike the Log_error API, no __FILE__ or __LINE__ information about
the call-site is logged with the error code.
EXAMPLE
The following C code shows how to log a legacy error code as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Int myHWErrorCode = 0xEC0DE;
...
Log_write1(UIAErr_hwError,myHWErrorCode);
...
"HW ERROR: ErrorCode:0xECODE."
SEE
C SYNOPSIS
| config UIAErr.hwErrorWithStr // module-wide |
|
hardware error event code and fmt string
msg: "HW ERROR: ErrorCode:0x%x. %$S"
};
VALUES
(%x) integer that identifies the type of error
(%$S) fmt string used to format the event message.
Up to 6 additional arguments can be logged with this event if
required. The formatting string should provide format specifiers
for each of the additional arguments
DETAILS
Used to log a generic hardware error.
EXAMPLE
The following C code shows how to log a legacy error code and an
associated string as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Int myHWErrorCode = 0xEC0DE;
String myHWErrorStr = "My description of hardware error 0xEC0DE";
...
Log_write2(UIAErr_hwErrorWithStr,myHWErrorCode,(IArg)myHWErrorStr);
...
"HW ERROR: ErrorCode:0xECODE. My description of hardware error 0xEC0DE"
SEE
C SYNOPSIS
| config UIAErr.illegalInstruction // module-wide |
|
illegalInstruction event code
msg: "ERROR: Illegal Instruction executed at %$F."
};
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that an illegal instruction was executed
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_illegalInstruction,(IArg)__FILE__,__LINE__);
...
"ERROR: Illegal Instruction executed at demo.c line 1234."
C SYNOPSIS
| config UIAErr.indexOutOfRange // module-wide |
|
indexOutOfRange event code
msg: "ERROR: Index out of range at %$F. [INDEX]0x%x"
};
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
index
The index value that was out of range
DETAILS
Used to log that an index out of range condition occurred.
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write3(UIAErr_indexOutOfRange,(IArg)__FILE__,__LINE__,badIndex);
...
"ERROR: OIndex out of range at demo.c line 1234. [INDEX]0xFFFFFFFF"
C SYNOPSIS
| config UIAErr.invalidParameter // module-wide |
|
invalidParameter event code
msg: "ERROR: Invalid Parameter at %$F. [ParamNum]%d [ParamValue]0x%x"
};
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
paramNum
The parameter number in the function's signature that was invalid
paramValue
The invalid parameter value
DETAILS
Used to log that an invalid parameter was detected
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Void myFunc(Int caseNumber){
switch(caseNumber){
...
break;
default :
Log_write4(UIAErr_floatingPointError,(IArg)__FILE__,__LINE__,1,caseNumber);
}
}
"ERROR: Invalid Parameter at demo.c line 1234. [ParamNum]1 [ParamValue]0xFFFFFFFF"
C SYNOPSIS
| config UIAErr.memoryAccessFault // module-wide |
|
memoryAccessFault event code
msg: "ERROR: Memory Access Fault at %$F. [ADRS]0x%x"
};
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
adrs
The address that caused the memory access fault
DETAILS
Used to log that a memory access fault occurred.
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write3(UIAErr_memoryAccessFault,(IArg)__FILE__,__LINE__,(IArg)badAdrs);
...
"ERROR: Memory Access Fault at demo.c line 1234. [ADRS]0xFFFFFFFF"
C SYNOPSIS
| config UIAErr.moduleNotFound // module-wide |
|
moduleNotFound event code
msg: "ERROR: Module not found at %$F. [MODULE_ID]0x%x."
};
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
moduleId
The Module ID of the module that was not found
DETAILS
Used to log that a module was not found
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write3(UIAErr_moduleNotFound,(IArg)__FILE__,__LINE__,moduleIdThatWasNotFound);
...
"ERROR: Module not found at demo.c line 1234. [MODULE_ID]0x32903"
C SYNOPSIS
| config UIAErr.notImplemented // module-wide |
|
notImplemented event code
msg: "ERROR: Attempt to access feature that is not implemented at %$F."
};
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that an attempt to access a feature that is not implemented
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_notImplemented,(IArg)__FILE__,__LINE__);
...
"ERROR: Attempt to access feature that is not implemented at demo.c line 1234."
C SYNOPSIS
| config UIAErr.nullPointerException // module-wide |
|
nullPointerException event code
msg: "ERROR: Null Pointer Exception at %$F."
};
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that a null pointer exception occurred.
Typically used with LogSnapshot or LogCrashDump APIs to
log stack dump data that identifies why the exception occurred.
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_nullPointerException,(IArg)__FILE__,__LINE__);
...
"ERROR: Null Pointer Exception at demo.c line 1234."
C SYNOPSIS
| config UIAErr.overflowException // module-wide |
|
overflowException event code
msg: "ERROR: Overflow exception at %$F."
};
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that an overflow exception occurred.
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_overflowException,(IArg)__FILE__,__LINE__);
...
"ERROR: Overflow exception at demo.c line 1234."
C SYNOPSIS
| config UIAErr.securityException // module-wide |
|
securityException event code
msg: "ERROR: Security Exception at %$F."
};
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that a security exception occurred.
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_securityException,(IArg)__FILE__,__LINE__);
...
"ERROR: Security Exception at demo.c line 1234."
C SYNOPSIS
| config UIAErr.stackOverflow // module-wide |
|
stackOverflow event code
msg: "ERROR: Stack Overflow detected at %$F."
};
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that a stack overflow was detected. (Event Level = CRITICAL)
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
Comments in the code can then provide further explication of the error.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_stackOverflow,(IArg)__FILE__,__LINE__);
...
"ERROR: Stack Overflow detected at demo.c line 1234."
C SYNOPSIS
| config UIAErr.uncaughtException // module-wide |
|
uncaughtException event code
msg: "ERROR: Uncaught Exception at %$F."
};
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that an uncaught exception occurred.
Typically used with LogSnapshot or LogCrashDump APIs to
log stack dump data that identifies why the exception occurred.
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_uncaughtException,(IArg)__FILE__,__LINE__);
...
"ERROR: Uncaught Exception at demo.c line 1234."
C SYNOPSIS
| config UIAErr.unexpectedInterrupt // module-wide |
|
unexpectedInterrupt event code
msg: "ERROR: Unexpected Interrupt at %$F."
};
VALUES
__FILE__
The file that the exception occurred in
__LINE__
The line that the exception occurred at
DETAILS
Used to log that an unexpected interrupt occurred.
EXAMPLE
The following C code shows how to log an exception that identifies
the file and line number that the exception occurred at as a UIA event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAErr.h>
...
Log_write2(UIAErr_unexpectedInterrupt,(IArg)__FILE__,__LINE__);
...
"ERROR: Null Pointer Exception at demo.c line 1234."
C SYNOPSIS
| metaonly config UIAErr.common$ // module-wide |
|
Common module configuration parameters
DETAILS
All modules have this configuration parameter. Its name
contains the '$' character to ensure it does not conflict with
configuration parameters declared by the module. This allows
new configuration parameters to be added in the future without
any chance of breaking existing modules.


detail/guard.hpp provides a type guard<Mutex> that allows scoped access to the
Mutex's locking and unlocking operations. It is
used to ensure that a Mutex is unlocked, even if
an exception is thrown.
detail/guard.hpp 提供了一个类型 guard<Mutex>，它可以对 Mutex 的锁定和解锁操作进行定域的访问。它用于确保一个 Mutex 即使在有异常抛出的情况下也会被解锁。
namespace details {
namespace pool {
template <typename Mutex>
class guard
{
private:
guard(const guard &);
void operator=(const guard &);
public:
explicit guard(Mutex & mtx);
~guard();
};
} // namespace pool
} // namespace details
| Symbol | Meaning |
|---|---|
| T | guard<Mutex> |
| m | value of type Mutex & |
| g | value of type guard<Mutex> |
| Expression | Return Type | Assertion/Note/Pre/Post-Condition |
|---|---|---|
| m.lock() | not used | Locks the mutex referred to by m 锁定由 m 指向的互斥体 |
| m.unlock() | not used | Unlocks the mutex referred to by m 解锁由 m 指向的互斥体 |
| Expression | Assertion/Note/Pre/Post-Condition |
|---|---|
| T(m) | Locks the mutex referred to by m; binds
T(m) to m 锁定由 m 指向的互斥体，将 T(m) 绑定至 m |
| (&g)->~T() | Unlocks the mutex that g is bound to 解锁 g 所绑定的互斥体 |
Given a (platform-specific) mutex class, we
can wrap code as follows:
给定一个(平台相关)的互斥体类，我们可以如下包装代码：
extern mutex global_lock;
static void f()
{
boost::details::pool::guard<mutex> g(global_lock);
// g's constructor locks "global_lock"
... // do anything:
// throw exceptions
// return
// or just fall through
} // g's destructor unlocks "global_lock"
None.
无。
This header will eventually be replaced by a Boost multithreading
library.
该头文件最终会被一个 Boost 多线程库所替代。
Revised 05 December, 2006
Copyright © 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT com)
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)