Program Variables (Symbols)
Symbols are representations of source code identifiers, such as the names of applications, modules, variables, functions, special function registers, or virtual registers. Usually, symbols are associated with debug information, for example: type, scope, or location of the identifier they represent. Symbols allow using the names of identifiers as defined in the original source code.
Enable Options for Target — Output — Debug Information to generate the information required for performing source-level and symbolic debugging.
The general form of a symbol name is:
[\\Application][[\[Path/]Module][\Identifier]]
| Application | represents the application name. Must be preceded with a double backslash (\\). |
| Path | represents the folder of the source code file. Separate folders from sub-folders with a slash (/). Must end with a slash (/). Path can:- be ignored for devices not using a Cortex-M processor.
- have an absolute or relative notation for devices that are using a Cortex-M processor.
See examples in Module. |
| Module | represents the name of a source module ( *.c, *.cpp). Can be preceded with a Path. Must begin with a backslash (\). For example, the compiler generates the object file Mcommand.obj for the source file Mcommand.c, then Module is:- Mcommand for devices not using a Cortex-M processor.
- Mcommand.c for devices that are using a Cortex-M processor.
Examples
Assuming the application folder is C:\ARM\Projs\Measure. Then the symbol name can have the form:
/* Mcommand.c resides in C:\ARM\Proj\Measure\src */
\\Measure\Mcommand // path ignored for non-Cortex-M.
// Module without file extension.
\\Measure\C:/ARM/Proj/Measure/src/Measure.c // absolute path (Cortex-M)
\\Measure\src/Measure.c // relative path
/* Mcommand.c resides in C:\ARM\Proj\src */
\\Measure\../src/Measure.c // relative path
Module names can be queried from the Command Window with the debugging command:
DIR module
|
| Identifier | represents a source code object. Must be separated from Module with a backslash (\). Can be used standalone and without backslash when unique in the application. Identifier can be a:- code line number.
- scalar variable (char, int, long, float, double).
- composite variable (array, structure, file).
- function.
- meaningful combination of the above.
Examples
\\Measure\Measure.c\87 // Code line number
\\Measure\Measure.c\sindex // Scalar variable
\\Measure\Measure.c\setinterval.min // Structure.StructMember
\\Measure\Measure.c\menu[1] // Array[element]
\\Measure\Measure.c\read_index // Function
\\Measure\Measure.c\read_index\index // Function\Scalar variable
|
This section contains descriptions for: