HP Getting Started a Ski Tutorial, Ski Simulator, How to Run an IA-64 Application Program

Page 13

Ski IA-64 Simulator Reference Manual 1.0L

1

Getting Started: A Ski Tutorial

 

 

 

 

In this chapter, you learn how to use Ski by executing a brief tutorial. At the end of the tutorial, you will learn where to look in this manual for detailed descriptions of Ski’s operation and commands. Introductory information on Ski is pre- sented in Chapter 2, “Overview”.

1.1The Ski Simulator

Ski simulates the IA-64 architecture and also has limited support for simulating IA-32 programs. Ski runs on IA-32 Linux host systems. You can use Ski for many purposes, as described in Section 2.1, “Introduction”. One of the most common uses of Ski is to test an IA-64 program in a Linux environment, and in this chapter, you will learn how to use xski, the X Window System version of Ski, by “walking through” a sample session, in about ten minutes. Ok, twenty minutes.

You should already be familiar with the IA-64 architecture and the C programming language, have xski installed on your Linux system, and have the XSki file in your home directory or in your X Window System app-defaults directory, typi- cally /usr/lib/X11/app-defaults. You will also need to have an executable Linux IA-64 program such as the classic

hello world” program.

1.2How to Run an IA-64 Application Program

Ski provides a Linux application environment in which an IA-64 program you provide can be simulated. The release notes provide the most up-to-date information on Ski’s support for the Linux Application Binary Interface (ABI). The following sections provide a short tutorial which leads you through an IA-64 program session with xski. You will learn how to use the most common Ski commands.

1.2.1Starting xski

As shown in Figure 1-1,start xski by typing its name to the Linux shell, just like any other Linux program, as shown in Figure 1-1.When running inside the IA-64 Linux Native User Environment (NUE), make sure that the environment vari- able DISPLAY is set to a string of the form hostname:display (e.g., ‘‘ myhost:0’’, values such as ‘‘ unix:0’’ or ‘‘ :0’’ won’t work) before invoking xski. If you have never run the simulator before, it will first prompt you to read and accept the software license it is distributed under. After accepting the license, the four primary xski windows will be displayed on your screen, as shown in Figure 1-2.No IA-64 program is loaded yet, so the Program Window and Data Window are empty. Scroll the various panes of the Register Window and note that with few exceptions, the registers are set to zero.

Copyright © 2000 Hewlett-Packard Co.

Getting Started: A Ski Tutorial

1-1

Image 13
Contents Copyright 2000 Hewlett-Packard Co Ski IA-64 Simulator Reference ManualTrademarks Printing HistoryPreface How to Use This ManualFont Conventions Syntax ConventionsItalic+ Table of Contents Ski IA-64 Simulator Reference Manual Vii Ski IA-64 Simulator Reference Manual Viii Table of Contents List of Figures Ski IA-64 Simulator Reference Manual 1.0L List of Tables Ski IA-64 Simulator Reference Manual 1.0L Xii List of Tables Getting Started a Ski Tutorial How to Run an IA-64 Application ProgramSki Simulator Starting xskiStarting xski From the Command Line Loading Your Program Exiting SkiLoading the hello Program Xski Data Window Inspecting DataChanging the Data Window Display Data Window Showing argv and envp Strings in Hexadecimal Looking at Code Viewing Data in Ascii12. Jumping the Program Window to the Beginning of main Viewing Source Code Mixed In with Assembly Code14. The Program Window Showing a Breakpoint at main Controlling Breakpoints15. The Breakpoint List Window Running a Program16. The Terminal Window After the hello Program is Run Single-stepping a Program18. The Main Window After Reaching the Breakpoint at main+10 Changing Registers and MemorySki IA-64 Simulator Reference Manual 1.0L 20. The xski Register Window After Changing the ip Register 21. The xski Data Window Widened to Show Ascii Next Steps Getting HelpCopyright 2000 Hewlett-Packard Co Introduction OverviewWhat You Need to Know to Use This Manual Defects and Defect ReportingSki Variations Using bski for Batch SimulationsX Window System, Motif-based xski Interface Starting Ski Command Line Flags1.1 Summary of Flags XSki FileQuitting Ski Summary of the Quit CommandQuit expression Ski’s Use of Windows Screen PresentationRegister Window Register Window in xski User Registers PaneFloating Point Registers Pane General Registers PaneIA-32 Registers Pane System Registers PaneRegister Window and ski Resizing Register Window Panes with xski1 IA-64 Instruction Display Program WindowSki IA-64 Simulator Reference Manual 1.0L 2 IA-32 Instruction Display Invalid Code and the Program Window Changing the Range of Locations Shown in the Program Window12. xski’s Program Window Showing Illegal Instructions Data WindowChanging the Range of Locations Shown in the Data Window Invalid Code and the Data Window Command/Main WindowXski Main Window 16. xski’s Main Command Window Ski Command WindowOther Windows 17. ski’s Command Window at Bottom18. xski’s Symbol List Window Copyright 2000 Hewlett-Packard Co Command Entry Command LanguageCommand Arguments Command Sequences, Repetition, and AbbreviationNumeric Arguments Argument SpecificationNumbers and Counts ExpressionsXski Evaluating Expressions Ski Simulator Arithmetic and Logic OperatorsProgram-Defined Symbols Symbolic ArgumentsAddresses Internal Variables Resolving Ambiguous Symbols and NumbersLabels FilenamesSki IA-64 Simulator Reference Manual 1.0L Register Window Commands Screen Manipulation CommandsSummary of Register Window Commands Xski Register Window CommandsSummary of Program Window Commands Program Window CommandsXski’s Program Window Showing IA-64 Assembly Language Code Pd startingaddress endingaddress filename Xski’s Assembly Language Dump WindowSummary of Data Window Commands Data Window CommandsDj address Df countDd startingaddress endingaddress filename Xski Showing Data in Raw Hexadecimal and AsciiApplication-Mode and System-Mode Simulation Program SimulationSki Support for Application-Mode Programs Ski Support for System-Mode ProgramsSystem-Mode IA-64 Programs Summary of TLB Display CommandsSystem-Mode IA-32 Programs System-Mode TLB SimulationHow to Load a Program Misaligned Data Access TrapProgram Loading Load filename args+ Summary of Program Loading CommandsAdding Information after Loading Creating the argc, argv, and envp ParametersProgram Execution Summary of Program Execution CommandsSki IA-64 Simulator Reference Manual 1.0L Program Simulation Interruptions Linux and MS-DOS ABI EmulationLinux Application Environment Linux System Calls Accepted but Ignored by Ski Linux System Calls Supported by SkiProgram I/O MS-DOS Application EnvironmentMS-DOS System Calls in Hexadecimal Supported by Ski Copyright 2000 Hewlett-Packard Co Summary of Assignment Commands Changing Registers and Memory with Assignment CommandsExamples of Assignment Commands DebuggingOriginal Program Loaded in ski Allocation Bit-encoded RegistersSetting Program Breakpoints Summary of The eval CommandEvaluating Formulas and Formatting Data Program BreakpointsListing Program Breakpoints Deleting Program BreakpointsUnexpected Breakpoints Summary of Program Breakpoint CommandsBs address Summary of Data Breakpoint Commands Setting Data BreakpointsData Breakpoints Deleting Data BreakpointsSummary of Save and Restore Commands Symbol Table CommandsSummary of Symbol Commands Dumping Registers and Memory to a FileIsyms filename Symlist Output from xskiSki IA-64 Simulator Reference Manual 1.0L Debugging Labels and Control Flow in Command Files Command FilesGoto Command and Labels Initialization FileAn Example Command File Comments in Command FilesIf Command filename Summary of Command File Commands# comment LabelSki IA-64 Simulator Reference Manual 1.0L Command Files =s address stringwithoutspaces Command ReferenceDbd breakpointnumber Dbs address length rwrwEval expressionwithoutspaces+ Help commandnameRest filename Quit returnvalueforshellStep until expressionwithoutspaces Ski IA-64 Simulator Reference Manual 1.0L IA-64 Registers Register NamesRegister Names Copyright 2000 Hewlett-Packard Co Register Names B-3 Ski IA-64 Simulator Reference Manual 1.0L Copyright 2000 Hewlett-Packard Co Register Names B-5 Ski IA-64 Simulator Reference Manual 1.0L Register Names Internal Variables Internal Variable NamesCopyright 2000 Hewlett-Packard Co All breakpoints deleted Simulator Status and Error MessagesSimulator Status and Error Messages Expression Help Unknown command %s Missing ELF header Not an IA-64 file Stopping at %s due to unimplemented instruction Usage %s options file args