![]() |
Event Recorder
Version 1.0.0
MDK Debugger Views for Status and Event Information
|
Provide memory usage information
The SCVD interpreter has built-in evaluation for expressions that are used in various XML elements and attributes. An expression is a combination of operands and Operators that evaluate to a resulting value where the type of the result is derived from the expression.
An operand may be a numeric constant, a variable, a built-in function, a predefined variable, or an expression. Operators are used to combine and compare operands.
Operators combine and compare operands. Operators may be unary (requiring one operand) or binary (requiring two operands). The combination of an operator and its operands is an expression. Parentheses can be used in expressions with multiple operators to specify the order of evaluation. If no parentheses are used in an expression, then the operator precedence determines the evaluation order.
Operators | Precedence | Description |
---|---|---|
( ) | 1 | Parentheses can be used to specify the order of evaluation |
.member | 2 | Type member |
typedef_name:member:enum | 2 | Enumerator value; refer to enum |
typedef_name:member | 2 | Type-member selector for use in __Offset_of intrinsic; refer to member |
Unary +, Unary — | 3 | Unary plus or minus applied to the following operand |
* / % | 4 | Multiplication, Division, or Modulo |
+ — | 5 | Addition, Subtraction |
<< >> | 6 | Shift left, Shift right |
& | ^ | 7 | Binary AND, OR, XOR |
== != > >= < <= | 8 | Comparisons |
&& || | 9 | Logical AND, OR |
e ? e : e | 10 | Conditional operator |
= |= &= ^= += -= *= /= %= | 11 | Assignment operators |
Examples:
Predefined variables can be used without a declaration or definition.
Predefined Variable | Description |
---|---|
__Running | Indicates program execution at target: 1=run, 0=stop |
_count | Counts the number of items in readlist and read elements. |
_addr | Returns the memory adress of a readlist member. |
The SCVD has built-in mechanisms to evaluate Expressions in various XML elements and attributes for calculations.
The table lists the predefined functions:
Function Name | Description |
---|---|
__CalcMemUsed | Provide memory usage information |
__FindSymbol | Get numeric value of symbol |
__GetRegVal | Read CPU register value |
__Symbol_exists | Search for symbol |
__Offset_of | Get offset of type member |
StackAddress | Start address of memory area |
StackSize | Size of memory area in Bytes |
FillPattern | Initial value of memory area, used to identify memory usage |
MagicValue | Initial value at end of memory area, used to identify memory (stack) overflow |
The function provides information about the memory usages and is typically applied for the stack memory of RTOS threads.
Example:
Get numeric value of symbol
symbol_name | Pointer to the name of a public symbol (examples: "main", "os_active_TCB", ...). |
The function searches for a public symbol and returns the numeric value of the symbol. If the symbol cannot be found, then a runtime error is thrown.
Read CPU register value
RegisterName | Pointer to the name of a CPU register: "PSP", "MSP", .... |
The function reads the value of a CPU register.
Search for symbol
symbol_name | Pointer to the name of a public symbol (examples: "main", "os_active_TCB", ...). |
The function searchs for a symbol in the application and returns 1 ehn the symblo was found, otherwise 0 for false.
Get offset of type member
typedef_mem_name | Is the member name of a specified type and has the form typedef_name:typedef_member_name. |
The function returns the offset value of the specified typedef member.
Example: