list

This command displays lines of source code surrounding the current or specified location. The default listing is 10 lines of source code unless you specify start and finish line numbers. You can use the set listsize command to modify the default settings.

Repeated commands display successive source lines in the same direction through the source file.

Show/hideSyntax

list [ [filename:]location | + | - | +offset | -offset] | [*address]

Where:

filename

Specifies the file.

location

Specifies the location:

line_num

is a line number

first,last

are start and finish line numbers

function

is a function.

+

Displays the source lines after the current location.

-

Displays the source lines before the current location.

offset

Specifies the line offset from the current location.

address

Specifies the address. This can be either an address or an expression that evaluates to an address.

Show/hideDefault

The default directories for searching are:

  • compilation directory, $cdir

  • current working directory, $cwd.

You can use the directory command to define additional search directories.

Show/hideExample

Example 68. list

list main           # Set current location to main() and display source
list +3             # Increment current location then display source
list -              # Decrement current location then display source
list *0x8120        # Set current location to address 0x8120 and display source
list 35             # Set current location to line 35 and display source
list dhry_1.c:10,23 # Display source lines 10 to 23 in dhry_1.c
list *main          # Set current location to address of main and display source

Show/hideSee also

Copyright © 2010, 2011 ARM. All rights reserved.ARM DUI 0452D
Non-ConfidentialID011411