You are on page 1of 47

HLL Debugging

Load the Application Program___________________________ 1


General Loader Options 2

The Symbol Database__________________________________ 5


Structure of the Internal Symbol Database 5

General Information on the Symbol Database 6

Symbol Browser 7

Details about a Selected Symbol 14

Searching in source files 16

Display Variables ____________________________________ 17


Watch Window 17

View Window 20

Referenced Variables 21

Local Variables 22

Stack Frame 23

Special Display for Arrays 24

Linked Lists 27

Variable Log_________________________________________ 30

Format Variable______________________________________ 34
Format a Variable using the Format Dialog Box 34

07/10/02
Format a Variable Using the Command Line 41

General SETUPs 42

Testing of functions __________________________________ 43

07/10/02
Load the Application Program

Command: Data.LOAD (General load command)

Format: Data.LOAD <filename> /<option>

Command: Data.LOAD.<subcommand> (Compiler specific load command)

Format: Data.LOAD.<subcommand> <filename> /<option>

Compiler-specific load command can be found in the ICD Target Manual.


Menu: Help→ICD Target Manual, section Compiler.

1
General Loader Options
The general loader options are independant from the compiler. A list of all general loader options is given with the
Data.LOAD command.

Verify Memory is checked after write. This is done by reading back the memory
immediatelly after a memory block is written.
ComPare Data in the memory is compared against the file, memory is not changed.
Loading is stopped after the first detected difference.
DIFF Data in the memory is compared against the file, memory is not changed.

• found() returns TRUE, when a difference between the file and the
memory is found

• found() returns FALSE, when no difference between the file and


the memory is found
NOCODE Download only symbol and debug information, useful if the program is
already in FLASH or ROM.

2
Loader options if more the one file is loaded

NoClear By default, whenever a new load command is started, the internal symbol
database is deleted. With this option the internal symbol data base is not
deleted. This option is necessary if more then one program is loaded.
MultiFile This option speeds up the downloading of large projects consisting of
serveral programs. This option suppresses the generation of the internal
symbol database when using the load command.

Example:

Data.LOAD file1 /multifile


Data.LOAD file2 /noclear /multifile
Data.LOAD file3 /noclear /multifile
.
.
.
Data.LOAD filen /noclear

Loader options to adjust the source path information

StripPATH Extracts the file name from the complete source path given in the object
file.
sYmbol.List.SOURCE

Data.LOAD.Elf armbe.axf /LowerPATH /StripPATH

New search pathes for the sources can be defined using the command
sYmbol.SPATH <path>.
The search order for newly defined pathes can be displayed using the
command
sYmbol.List.SPATH

sYmbol.SPATH F:\rob\test\si
sYmbol.SPATH F:\rob\test\conf
sYmbol.SPATH F:\rob\bat\test

3
StripPART <n> Parts from the source path stored in the object file are removed.

sYmbol.List.SOURCE

Data.LOAD.Elf armbe.axf /LowerPATH /StripPART 2.

sYmbol.SPATH F:\rob

Loader options for the Virtual Memory

TRACE32-ICD provides a so-called virtual memory on the host. With the following options the code is loaded into
this virtual memory.
The virtual memory is mainly used for program flow traces e.g. MPC500/800, ARM-ETM … Since only reduced
trace information is sampled, the TRACE32-ICD also needs the code from the target memory in order to provide
a full trace listing. If the on-chip debugging logic of the processor does´t support memory read while the program
is executed a full trace display can only be provided if the program execution is stopped.
If the code is loaded into the virtual memory TRACE32-ICD can use code from the virtual memory in order to
provide a full trace listing.

VM Load the code into the virtual memory.


PlusVM Load the code into the target and into the virtual memory.

4
The Symbol Database

Structure of the Internal Symbol Database

Program
Types

Module Global
Variable Sections

Function Module Source


Variable

Variable Variable Line


(static) (dynamic)

Column

5
General Information on the Symbol Database

Command: sYmbol.STATE

Format: sYmbol.STATE

6
Symbol Browser

Command: sYmbol.Browse

Format: sYmbol.Browse [<name_pat>] [<type_pat>] [/<option>]

7
Global Browsing

Global Up Global Down

* represents any symbol/variable/function

\\* Program

\\*\* Module Global


Variable

\\*\*\* Function Module


Variable

\\*\*\*\* Variable Variable


(static) (dynamic)

8
Display of file names instead of module names

Move the small square to the right, to get the module names for the symbols

If Source is ON, the name of the source file is displayed


instead of the module name

9
Narrowed Browsing

Select display type

Symbols Display all symbols

Variables Display all variables

Functions Display all functions

Modules Display all modules

10
If the browsing is narrowed to
Variables and a function is selected,
the local variables of the selected
function are displayed

If the browsing is narrowed to


Functions and a function is selected,
the source code of the selected function
is displayed

11
Browse Modules

Browse Functions

Browse Variable

Command: sYmbol.Browse.sYmbol
Command: sYmbol.Browse.Function
Command: sYmbol.Browse.Var
Command: sYmbol.Browse.Modules

Format: sYmbol.Browse.* [<name_pat>] [<type_pat>] [/<option>]

12
Browsing for a Specific Type

Display all variables of the type


unsigned int

Display all variables where the type


name contains the keyword char
(*char*)

Display all variables of the type


pointer to char (*char ″*″)

13
Details about a Selected Symbol

14
Select the variable you are interested in

15
Searching in source files

Search a string in the current source file

If Debug mode HLL is active, the entered string is searched in the current source file.

current source file

Search a string in all source files

Enter the string here

16
Display Variables

Watch Window
Adds the selected variable to the top of the Variable Watch Window. If no Watch Window exists, a new Watch
Window is created.

The selected variable is added to the top


of the Variable Watch window

17
Add the variable to the
Watch Window by using
the Variable pull down

Drag variable to the


the Watch Window

Remove selected variable


from Watch Window

18
Command: Var.Watch (Open a new variable watch window)

Format: Var.Watch [<%format>] [<variable>]

Command: Var.AddWatch (Add a variable to the watch window)

Format: Var.AddWatch [<%format>] [<variable>]

• If no variable watch window exists, a new watch window is displayed.

• If several variable watch windows exist, the variable will be added to the watch window in front.

19
View Window
Opens a new Variable View Window for the selected variable.

A new Variable View Window is opened


to display the selected variable

Command: Var.View

Format: Var.View [<%format>] [<variable>]

• A new window is opened each time the command is entered.

• If a formula is entered, it is interpreted and the result is displayed.

20
Referenced Variables
Opens a Var.Ref Window. The variables referenced by the current source line are automatically added to this
window.

Command: Var.Ref

Format: Var.Ref [<%format>] [/TRACK]

21
Local Variables
To open a window to display the local variables of the current function.

Command: Var.Local

Format: Var.Local [<%format>]

22
Stack Frame
Display a “stack trace” to show the functions´ nesting.

Args Display the arguments

Local Display the local variables

Caller Display of the high level language block, from which the function was
called.

Command: Var.Frame

Format: Var.Frame [<%format>] [/option]

23
Special Display for Arrays

Graphical Display

To displays the contents of an array graphically use:

Command: Var.DRAW

Format: Var.DRAW [<%format>] <array_expression>

Var.DRAW sinewave

24
Display Array with Indices and Pointers

To display an array together with the indices and pointers to the array use:

Command: Var.TABle

Format: Var.TABle [<%format>] [<array> <index> ....]

Var.TABle flags i k vpchar

Display nth element on


top of the window
Display first element on
top of the window
Display last element on
top of the window

25
Compress the array

Command: Var.FixedTABle

Format: Var.FixedTABle [<%format>] [<array> <index> ....]

Var.FixedTABle stra2 vpchar

26
Linked Lists
To display a linked list use:

Command: Var.CHAIN

Format: Var.CHAIN [<%format>] <first> <next> ....]

Var.CHAIN ast ast.left

27
Display nth element on
top of the window
Display first element on
top of the window
Display last element on
top of the window

Scan Modes The linked list is permanently scanned to keep it up to date. This
may reduce the performance of the TRACE32 user interface. 3 dif-
ferent scan modes are supported

Full The linked list is scanned completely. This may reduce the perfor-
mance of the TRACE32 user interface considerably.

Partial The linked list is only scanned from the record at the top of the
screen. The influence on the performance of the TRACE32 user
interface is very small.

Auto This mode provides a compromise between an up to date linked list


and a fast TRACE32 user interface. For a specific time (20-50 ms)
the list is updated and for the same time user inputs are served. The
number beside the Auto button is the number of the last updated
record.

28
Command: Var.FixedCHAIN

Format: Var.FixedCHAIN [<%format>] <first> <next> ....]

Var.FixedCHAIN ast ast.left

29
Variable Log

Select the variable


you want to log

Open the message area

Whenever the program stops the


current value of the selected variable
is recorded to the message area

Command: Var.LOG

Format: Var.LOG [<%format>] [<variable>] … [/<option>]

• Use Var.Log without any parameters to switch of the log.

30
Display the log in a special window

To create a special window for the variable log, use the following commands:

Command: AREA.Create (Create a special window)

Format: AREA.Create <area>

Command: AREA.view (Display a special window)

Format: AREA.view <area>

AREA.Create Log1
Area.view Log1
Var.LOG flags /AREA Log1

AREA.Create Log1
Area.view Log1
Var.LOG flags /AREA Log1 /Changes ;Variable is only recorded when it
;has changed since the last program
;stop

31
Save the log to a file

To create a special window for the variable log, use the following commands:

Command: AREA.OPEN (Open output file for AREA window)

Format: AREA.OPEN <area> <filename>

Command: AREA.CLOSE (Close output file for AREA window)

Format: AREA.CLOSE <area>

AREA.Create Log1
Area.view Log1
AREA.OPEN Log1 loglist.lst
Var.LOG flags /AREA Log1
AREA.CLOSE Log1
Var.LOG

32
Log the variable on each Spotpoint

AREA.Create Log1
Area.view Log1
Var.LOG flags /AREA Log1 /ONSPOT

Switch off the log


Var.LOG

Var.LOG without any argument switches the log off.

33
Format Variable

Format a Variable using the Format Dialog Box

Select the variable and press the


right mouse button to open the
Format dialog box

34
General Examples

• Numeric formats

Select the numeric format,


more then one possible

Click to the small dot on


the left side of the variable
to display a numeric value
in a different format

35
• Information on type and location

Display variable with type and


location information

36
Examples for Arrays

• Index display

Display array with indices

• Fixed width for array elements

Use fixed space between the


elements of an array

37
• Array as string

Display the array as a string

Examples for Structures

• Tree display (default)

Tree allows to display a tree


view of a structure. Allows to
select which elements are
displayed

38
Examples for Pointers

• Symbolic display, short dump, string

Displays the contents of a pointer also


as a symbol
Displays a short memory dump of the
memory referenced by a pointer

Displays the memory referenced by the


pointer as a zero terminated ASCII string

39
More Examples

• Mark changes

Highlight all changed variable


elements

• Realtime update

Realtime update

40
Format a Variable Using the Command Line

If a variable is formatted using the Format dialog box, the format information
will not be stored when the windows configuration is saved in a PRACTICE file.

The format information will be stored only, if the variable was formatted using
the command line.

Command: Var.View

Format: Var.View [<%format>] [<variable>]

• Format definitions are valid for all variables used in the command after the format definition.

• Format definitions can be switched off selectivly.

41
General SETUPs

Command: SETUP.Var

Format: SETUP.Var [<%format>…]

42
Testing of functions

Command: Var.set

Format: Var.set [<%format>] <var>

Call a function with its arguments. The return value of the function is displayed in the state line.

Var.set func5(4,8,17)

43
Command: Var.Call

Format: Var.Call [<%format>] <expression>

If the expression is a function call, this function is entered and the program counter points to the first
instruction of the function.

The values of the CPU registers before the function call can be recalled with the
Register.SWAP command.

Var.set func13(3,8,5)

The program counter


points to the first
instruction of the
function. You can now
test the function.

44
Since no information was
saved on the stack at the
function call use Register
Swap to restore all CPU
registers to the values
before the function call

45

You might also like