Go to main content
Oracle® Developer Studio 12.5: Debugging a Program with dbx

Exit Print View

Updated: June 2016
 
 

list Command

The list command displays lines of a source file. It has the same syntax and functionality in native mode and in Java mode.

The default number of lines listed, N, is controlled by the dbx output_list_size environment variable.

Syntax

list

List N lines.

list number

List line number number.

list +

List next N lines.

list +n

List next n lines.

list -

List previous N lines.

list -n

List previous n lines.

list n1, n2

List lines from n1 to n2.

list n1, +

List from n1 to n1 + N.

list n1, +n2

List from n1 to n1 + n2.

list n1, -

List from n1-N to n1.

list n1, -n2

List from n1-n2 to n1.

list function

List the start of the source for function. list function changes the current scope. See Program Scope for more information.

list filename

List the start of the file filename.

list filename:n

List file filename from line n.

where:

filename is the file name of a source code file.

function is the name of a function to display.

number is the number of a line in the source file.

n is a number of lines to display.

n1 is the number of the first line to display.

n2 is the number of the last line to display. Where appropriate, the line number can be ”$” which denotes the last line of the file. Comma is optional.

Options

–i or –instr

Intermix source lines and assembly code.

–w or –wn

List N (or n) lines (window) around line or function. This option is not allowed in combination with the plus sign (+) or minus sign (-) syntax or when two line numbers are specified.

–a

When used with a function name, lists the entire function. When used without parameters, lists the remains of the current visiting function, if any.

Examples

list                      // list N lines starting at current line
list +5                      // list next 5 lines starting at current line
list -                    // list previous N lines
list -20                  // list previous 20 lines
list 1000                 // list line 1000
list 1000,$               // list from line 1000 to last line
list 2737 +24             // list line 2737 and next 24 lines
list 1000 -20             // list line 980 to 1000
list test.cc:33           // list source line 33 in file test.cc
list -w                   // list N lines around current line
list -w8 ”test.cc”func1   // list 8 lines around function func1
list -i 500 +10                // list source and assembly code for line
                500 to line 510