1.6.2. Program symbols

Program symbols are identifiers associated with a source program. They include variables, function names, and, depending on the compiler, macro names. Symbols defined in the source of the application can normally be passed to the debugger. When a program is loaded for debugging, program symbols are normally loaded into a symbol table associated with the target connection.

Some compilers insert a leading underscore _ to all program source symbols so that program symbol names are distinguished from other names. The debugger strips the first leading underscore from such program symbols when an application file is read so references to program symbols are as originally written.

Some compilers pass C and C++ preprocessor macros to the debugger. These are also usable in expressions. The debugger shows the expansion in the output.

Listing Symbols

You can list all symbols currently defined in RealView Debugger. To do this, enter:

printsymbols /w *

For more details on using this command, see PRINTSYMBOLS on PRINTSYMBOLS.

Referencing symbols

References to symbols or source-level line numbers can be unqualified or qualified. An unqualified reference includes only the symbol or line number itself. A qualified reference includes the symbol or line number preceded by a root (defined in the following section), module and/or function name. Root, module, and function names are separated from the symbol or line number by a backslash \. Module names must be in uppercase. Table 1.2 summarizes examples of qualified symbols.

Table 1.2. Qualified symbol references

FormExampleComment
@root\\@tst\\TS1ROOTReferences module TS1ROOT in root @tst. (Usually from file loaded as tst.x or tst.out.)
\global ::global\x ::xReferences global variable x in current root.
function\localmain\xReferences local variable x in function main.
MODULE\functionSIEVE\mainReferences function main in module sieve.
MODULE\staticSIEVE\yReferences static variable y in module sieve.
MODULE\line_numberENTRY\#18References line number 18 in module entry.
MODULE\function\localENTRY\main\xReferences local variable x in function main in module entry.
LINE\local#20\xReferences local variable x in an unnamed block at line 20.
Copyright © 2005, 2006 ARM Limited. All rights reserved.ARM DUI 0284C
Non-Confidential