Ski IA-64 Simulator Reference Manual 1.0L

display off or on using the pa (“ program assembly”) and pm (“ program mixed”) 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 -gflag 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 -gflag. Make sure the Program Window is in mixed mode for now.

1.2.8Controlling 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 (“ breakpoint set”). 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-14shows. (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.

Figure 1-14. The Program Window Showing a Breakpoint at main()

Use the “ bl” command (“ breakpoint list”) 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 (“ breakpoint delete”). Use the “ bD” command (“ breakpoint Delete all”) to delete all breakpoints at once. Delete all your breakpoints before continuing this tutorial.

1-10 Getting Started: A Ski Tutorial

Copyright © 2000 Hewlett-Packard Co.

Page 22
Image 22
HP Ski Simulator, IA-64 manual Controlling Breakpoints, The Program Window Showing a Breakpoint at main