In This Book

Examples

The following examples illustrate some of the capabilities of the line-mode user interface.

Invoke the debugger to debug the program average .

$dde -ui ui_line average

Executing

image in process

23640: "/home/smith/average".

Break at: \\average\main\44

 

Source

File: /home/smith/average.c

44

B>

print_average

(my_list, first, last);

Print source lines and assembly code in the transcript area.

dde>

property transcript -source -asm

 

dde>

step

-instruction

 

 

Stepped to: \\average\main\44 (0000202C)

 

44

B)

print_average

(my_list, first,

last);

asm:

0000202C main+000c

LDO

R'6d8(%r1),%r26

Set a watchpoint and the print source and the watched variable in the transcript area.

dde> watchpoint \\average\print_average\total

(Warning) The location of variable 'total' is not in an active frame. dde> property transcript -source-variable

dde>

step -over

 

 

The

initial value

of \\`main(4)\average\print_average\total is 0

var:

 

33)

\\`main(4)\average\print_average\total: 0

The

value of

\\`main(4)\average\print_average\total

has changed from 0 to 36.

var:

 

33)

\\`main(4)\average\print_average\total:

36

31

>

 

num_elements = high - low;/* note

this is an off-by-one bug */

asm:

 

 

31:

00001FBC print_average+0030 LDW

-108(%r30),%r1

Stopped

at:

\\average\print_average\31

 

A

Line-Mode User Interface A-5