HP Ski Simulator manual Program Window, 1 IA-64 Instruction Display

Page 42

Ski IA-64 Simulator Reference Manual 1.0L

Figure 3-8. The ski Register Window (at Top)

3.5The Program Window

The Program Window provides a view into the program space. Whether you load a program into the simulated processor’s address space via the command line or using Ski’s load, iaload, or romload commands, the program is displayed in a format resembling a compiler’s assembler listing file. For IA-64 programs compiled from a high-level language such as ‘C’ and linked with the appropriate options, the source code is displayed with line numbers, mixed in with the generated assembly language as shown in Figure 3-9.As an example, to compile the “hello world” program with the IA-64 compiler used in testing Ski, the command line is:

cc -o hello -g hello.c

Note that the -O(capital-O) “optimization” flag was not specified. Optimization, by definition, rearranges the object code. If you turn on optimization, the correspondence between source code and object code will be obscured and you may find the resulting display difficult to interpret.

IA-64 assembly code is displayed through disassembly; the original assembler source code is not displayed. Source code for IA-32 programs, high-level and assembly, is not displayed.

Ski chooses whether to interpret the instructions as IA-64 or IA-32 encodings based on the setting of the psr.is bit. If your program has a mix of IA-64 and IA-32 code, you may need to manually set or clear this bit when trying to view a part of the program that is in a different encoding from the encoding at the current ip location. You can set the bit with the Ski command “ = psr.is 1” and you can clear the bit with “ = psr.is 0”. If the bit is set incorrectly, Ski will use the wrong instruction decoder and will show IA-64 code disassembled as if it was IA-32 code or vice-versa! Remember to set the bit back before resuming simulation.

3.5.1IA-64 Instruction Display

Each IA-64 instruction bundle is labelled on the left with an hexadecimal byte-addressed offset from the nearest, preced- ing symbol up to 0xffff bytes away. If the symbol name and offset are longer than sixteen characters, the first fifteen are displayed and an asterisk (“ *”) is added to indicate that the symbolic display has been abbreviated. For each 128 bit bun- dle, the two or three instructions are displayed in the center of the window with operands to their immediate right. The template for the bundle is shown as a triplet of capital letters, such as “ MII,” to the right of the last operand of the first

3-6

Screen Presentation

Copyright © 2000 Hewlett-Packard Co.

Image 42
Contents Ski IA-64 Simulator Reference Manual Copyright 2000 Hewlett-Packard CoPrinting History TrademarksFont Conventions How to Use This ManualPreface 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 Ski Simulator How to Run an IA-64 Application ProgramGetting Started a Ski Tutorial Starting xskiStarting xski From the Command Line Exiting Ski Loading Your ProgramLoading the hello Program Inspecting Data Xski Data WindowChanging the Data Window Display Data Window Showing argv and envp Strings in Hexadecimal Viewing Data in Ascii Looking at CodeViewing Source Code Mixed In with Assembly Code 12. Jumping the Program Window to the Beginning of mainControlling Breakpoints 14. The Program Window Showing a Breakpoint at mainRunning a Program 15. The Breakpoint List WindowSingle-stepping a Program 16. The Terminal Window After the hello Program is RunChanging Registers and Memory 18. The Main Window After Reaching the Breakpoint at main+10Ski 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 Getting Help Next StepsCopyright 2000 Hewlett-Packard Co What You Need to Know to Use This Manual OverviewIntroduction Defects and Defect ReportingUsing bski for Batch Simulations Ski VariationsX Window System, Motif-based xski Interface Command Line Flags Starting SkiXSki File 1.1 Summary of FlagsSummary of the Quit Command Quitting SkiQuit expression Screen Presentation Ski’s Use of WindowsRegister Window User Registers Pane Register Window in xskiGeneral Registers Pane Floating Point Registers PaneSystem Registers Pane IA-32 Registers PaneResizing Register Window Panes with xski Register Window and skiProgram Window 1 IA-64 Instruction DisplaySki IA-64 Simulator Reference Manual 1.0L 2 IA-32 Instruction Display Changing the Range of Locations Shown in the Program Window Invalid Code and the Program WindowData Window 12. xski’s Program Window Showing Illegal InstructionsChanging the Range of Locations Shown in the Data Window Command/Main Window Invalid Code and the Data WindowXski Main Window Ski Command Window 16. xski’s Main Command Window17. ski’s Command Window at Bottom Other Windows18. xski’s Symbol List Window Copyright 2000 Hewlett-Packard Co Command Arguments Command LanguageCommand Entry Command Sequences, Repetition, and AbbreviationNumbers and Counts Argument SpecificationNumeric Arguments ExpressionsSki Simulator Arithmetic and Logic Operators Xski Evaluating ExpressionsSymbolic Arguments Program-Defined SymbolsAddresses Labels Resolving Ambiguous Symbols and NumbersInternal Variables FilenamesSki IA-64 Simulator Reference Manual 1.0L Summary of Register Window Commands Screen Manipulation CommandsRegister Window Commands Xski Register Window CommandsProgram Window Commands Summary of Program Window CommandsXski’s Program Window Showing IA-64 Assembly Language Code Xski’s Assembly Language Dump Window Pd startingaddress endingaddress filenameDj address Data Window CommandsSummary of Data Window Commands Df countXski Showing Data in Raw Hexadecimal and Ascii Dd startingaddress endingaddress filenameSki Support for Application-Mode Programs Program SimulationApplication-Mode and System-Mode Simulation Ski Support for System-Mode ProgramsSystem-Mode IA-32 Programs Summary of TLB Display CommandsSystem-Mode IA-64 Programs System-Mode TLB SimulationMisaligned Data Access Trap How to Load a ProgramProgram Loading Adding Information after Loading Summary of Program Loading CommandsLoad filename args+ Creating the argc, argv, and envp ParametersSummary of Program Execution Commands Program ExecutionSki IA-64 Simulator Reference Manual 1.0L Program Simulation Linux and MS-DOS ABI Emulation InterruptionsLinux Application Environment Linux System Calls Supported by Ski Linux System Calls Accepted but Ignored by SkiMS-DOS Application Environment Program I/OMS-DOS System Calls in Hexadecimal Supported by Ski Copyright 2000 Hewlett-Packard Co Examples of Assignment Commands Changing Registers and Memory with Assignment CommandsSummary of Assignment Commands DebuggingOriginal Program Loaded in ski Bit-encoded Registers AllocationEvaluating Formulas and Formatting Data Summary of The eval CommandSetting Program Breakpoints Program BreakpointsDeleting Program Breakpoints Listing Program BreakpointsSummary of Program Breakpoint Commands Unexpected BreakpointsBs address Data Breakpoints Setting Data BreakpointsSummary of Data Breakpoint Commands Deleting Data BreakpointsSummary of Symbol Commands Symbol Table CommandsSummary of Save and Restore Commands Dumping Registers and Memory to a FileSymlist Output from xski Isyms filenameSki IA-64 Simulator Reference Manual 1.0L Debugging Goto Command and Labels Command FilesLabels and Control Flow in Command Files Initialization FileComments in Command Files An Example Command FileIf Command # comment Summary of Command File Commandsfilename LabelSki IA-64 Simulator Reference Manual 1.0L Command Files Command Reference =s address stringwithoutspacesDbs address length rwrw Dbd breakpointnumberHelp commandname Eval expressionwithoutspaces+Quit returnvalueforshell Rest filenameStep until expressionwithoutspaces Ski IA-64 Simulator Reference Manual 1.0L Register Names IA-64 RegistersRegister 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 Variable Names Internal VariablesCopyright 2000 Hewlett-Packard Co Simulator Status and Error Messages All breakpoints deletedSimulator 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