HP (Hewlett-Packard) IA-64 User Manual

Page of 110
1-10
Getting Started: A Ski Tutorial
Copyright © 2000 Hewlett-Packard Co.
Ski IA-64 Simulator Reference Manual 1.0L
display off or on using the
pa
(“
p
rogram
a
ssembly”) and
pm
(“
p
rogram
m
ixed”) commands, respectively. Mixed code dis-
play only works if you have the source code to the program available to Ski; the source code isn’t embedded in the ELF
file. Also, you must compile your code with the appropriate compiler flags, for example, with the
-g
flag used by many C
compilers to generate debug line record information. If your program is composed of multiple object files, for example
cc -o test foo.o bar.o baz.o
”, Ski can only show source code from the files compiled with the
-g
flag. Make sure
the Program Window is in mixed mode for now.
1.2.8
Controlling Breakpoints
You can think of Ski as a debugger that happens to work on a simulated processor rather than a real processor. Like any
good debugger, Ski provides breakpoints. To set a breakpoint in an IA-64 program, use the “
bs
” command (“
b
reakpoint
s
et”). In the example that follows, you will want to have the Program Window display the area of code near main(). Use
the command “
pj main
”, as you learned above.
To set a breakpoint at the beginning of main(), type “
bs main
” in the Main Window. The Program Window shows a “
0
in the first column of the window at the breakpoint location (the
‘‘alloc’’
instruction), because you just used breakpoint #0,
as Figure 1-14 shows. (The first three columns are also used for line numbers.) Set a breakpoint at
main+10
and another at
main+20
. Ski lets you set up to ten breakpoints.
Use the “
bl
” command (“
b
reakpoint
l
ist”) to see a list of the breakpoints, as shown in Figure 1-15. If you prefer using a
mouse, use the “Breakpoints” item on the View menu instead of the “
bl
” command. When you are finished viewing the
breakpoint list, click its
Close
 button to dismiss the window.
To delete breakpoints individually, use the “
bd
” command (“
b
reakpoint
d
elete”). Use the “
bD
” command (“
b
reakpoint
D
elete all”) to delete all breakpoints at once. Delete all your breakpoints before continuing this tutorial.
Figure 1-14. The Program Window Showing a Breakpoint at main()