Page 1
User’s Guide HP B1476 68020/030 Debugger/Emulator...
Page 2
Notice Hewlett-Packard makes no warranty of any kind with regard to this material, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. Hewlett-Packard shall not be liable for errors contained herein or for incidental or consequential damages in connection with the furnishing, performance, or use of this material.
Page 3
Printing History New editions are complete revisions of the manual. The date on the title page changes only when a new edition is published. A software code may be printed before the date; this indicates the version level of the software product at the time the manual was issued. Many product updates and fixes do not require manual changes, and manual corrections may be done without accompanying product changes.
Page 4
The HP B1476 68020/030 Debugger/Emulator is a debugging tool for 68020 and 68030 microprocessor code. The debugger loads and executes C programs or assembly language programs on an HP 64748 or HP 64747 emulator. The code is executed in real time unless a specific feature of the debugger or emulator requires halting the processor.
Page 5
With the Graphical Interface You Can ... • Use the debugger under an X Window System that supports OSF/Motif interfaces. • Enter debugger commands using pull-down or pop-up menus. • Set source-level breakpoints using the mouse. • Create custom action keys for commonly used debugger commands or command files.
Page 6
In This Book This book is organized into five parts: Part 1. Quick Start Guide An overview of the debugger and a short lesson to get you started. Part 2. User’s Guide How to use the debugger to solve your problems. Part 3.
Contents Part 1 Quick Start Guide 1 Getting Started with the Graphical Interface The Graphical Interface at a Glance Pointer and cursor shapes The Debugger Window Graphical Interface Conventions Mouse Buttons Platform Differences The Quick Start Tutorial The Demonstration Program To prepare to run the debugger To start the debugger To activate display area windows...
Page 8
Contents To recall an entry buffer value To display the address of a variable To break on an access to a variable To use the command line To use a C printf command To turn the command line off To trace events following a procedure call To see on-line help To end the debugging session 2 Getting Started with the Standard Interface...
Page 9
Contents Part 2 User’s Guide 3 Entering Debugger Commands Using Menus, the Entry Buffer, and Action Keys To choose a pull-down menu item using the mouse (method 1) To choose a pull-down menu item using the mouse (method 2) To choose a pull-down menu item using the keyboard To choose pop-up menu items To use pop-up menu shortcuts To place values into the entry buffer using the keyboard...
Page 10
Contents Last Breakpoint Trace Status If pop-up menus don’t pop up 4 Loading and Executing Programs Compiling Programs for the Debugger Using a Hewlett-Packard C Cross Compiler Using Microtec Language Tools Loading Programs and Symbols To specify the location of C source files To load programs To load programs only To load symbols only...
Page 11
Contents To reset program variables Loading a Saved CPU State To load a saved CPU state Using the MC68030 Memory Management Unit The deMMUer The emulator/analyzer interface Restrictions when using the MMU To enable the MMU Accessing the UNIX Operating System To fork a UNIX shell To execute a UNIX command Using the Debugger and the Emulator Interface...
Page 12
Contents Displaying Windows To change the active window To select the alternate view of a window To view information in the active window To view information in the "More" lists mode To copy window contents to a file Displaying C Source Code To display C source code To find first occurrence of a string To find next occurrence of a string...
Page 13
Contents Viewing Memory Contents To compare two blocks of memory To search a memory block for a value To examine a memory area for invalid values To display memory contents How Simulated I/O Works Simulated I/O Connections Special Simulated I/O Symbols To enable simulated I/O To disable simulated I/O To set the keyboard I/O mode to cooked...
Page 14
Contents 7 Editing Code and Data Editing Files To edit source code from the Code window To edit an arbitrary file To edit a file based on an address in the entry buffer To edit a file based on the current program counter Patching Source Code To change a variable using a C expression To patch a line of code using a macro...
Page 15
Contents To stop a macro To display macro source code To delete a macro Using Command Files To record commands To place comments in a command file To pause the debugger To stop command recording To run a command file To set command file error handling To append commands to an existing command file To record commands and results in a journal file...
Page 16
Contents To display half-bright or inverse video highlights To display information a screen at a time (more) To specify scroll amount To store timing information when tracing To mask fetches while tracing Modifying Display Area Windows To resize or move the active window To move the Status window To define user screens and windows To display user-defined screens...
Page 17
Contents Emulator Configuration Items Memory Emulation Monitor Break Conditions Other Configuration Items To enter the monitor after configuration To restrict to real-time runs To enable the processor cache memory To enable one wait state for emulation memory To change the memory configuration To enable the MC68030 Memory Management Unit To select and configure the MC68030 emulation monitor To select and configure the emulation monitor...
Page 18
Contents Part 3 Concept Guide 11 X Resources and the Graphical Interface An X resource is user-definable data A resource specification is a name and a value Don’t worry, there are shortcuts But wait, there is trouble ahead Class and instance apply to applications as well Resource specifications are found in standard places Loading order resolves conflicts between files The app-defaults file documents the resources you can set...
Page 20
Contents File Window_Close Memory Assign Memory Block_Operation Copy Memory Block_Operation Fill Memory Block_Operation Match Memory Block_Operation Search Memory Block_Operation Test Memory Display Memory Register Memory Unload_BBA Program Context Display Program Context Expand Program Context Set Program Display_Source Program Find_Source Next Program Find_Source Occurrence Program Load Program Pc_Reset...
Page 21
Contents Trace Trigger List Trace Trigger Never Window Active Window Cursor Window Delete Window Erase Window New Window Resize Window Screen_On Window Toggle_View 13 Expressions and Symbols in Debugger Commands Expression Elements Operators Constants Symbols Program Symbols Debugger Symbols Macro Symbols Reserved Symbols Line Numbers Addresses...
Page 22
Contents Referencing Symbols Evaluating Symbols Stack References 14 Reserved Symbols 15 Predefined Macros break_info byte close cmd_forward dword error fgetc fopen key_get key_stat memchr memclr memcpy memset open pod_command read reg_str showversion strcat strchr strcmp strcpy stricmp strlen strncmp until when word write...
Page 23
18 Installation Installation at a Glance Supplied interfaces Supplied filesets Emulator/Analyzer Compatibility To install software on an HP 9000 system Required Hardware and Software Step 1. Install the software To install the software on a Sun SPARCsystem™ Required Hardware and Software...
Page 24
To add an emulator to the /etc/hosts file To verify the software installation To remove software Configuring Terminals for Use with the Debugger To configure HP terminals or bit-mapped displays To configure the DEC VT100 terminal To configure the VT220 terminal To set the TERM environment variable...
Getting Started with the Graphical Interface How to get started using the debugger’s graphical interface.
Page 28
Chapter 1: Getting Started with the Graphical Interface When an X Window System that supports OSF/Motif interfaces is running on the host computer, the debugger has a graphical interface that provides features such as pull-down and pop-up menus, point and click setting of breakpoints, cut and paste, on-line help, customizable action keys and pop-up recall buffers.
Chapter 1: Getting Started with the Graphical Interface The Graphical Interface at a Glance Pointer and cursor shapes Arrow The arrow mouse pointer shows where the mouse is pointing. Hand The hand mouse pointer indicates that a pop-up menu is available by pressing the right mouse button.
Chapter 1: Getting Started with the Graphical Interface The Debugger Window Menu bar Action keys Entry buffer Scroll bar Display area Status line Command line...
Page 31
Chapter 1: Getting Started with the Graphical Interface Menu Bar. Provides pull-down menus from which you select commands. When menu items are not applicable, they appear half-bright and do not respond to mouse clicks. Action Keys. User-defined pushbuttons. You can label these pushbuttons and define the action to be performed.
Chapter 1: Getting Started with the Graphical Interface Graphical Interface Conventions This manual uses a shorthand notation for indicating that you should choose a particular menu item. For example, the following instruction Choose File→Load→Executable... means to select the File menu, then select Load from the File menu, then select the Executable...
Chapter 1: Getting Started with the Graphical Interface Mouse Buttons Mouse Buttons Mouse Button Descriptions Button Name General Function left Selects pushbuttons. Pastes from the display area to the entry buffer. middle Pastes from the entry buffer to the command line text area.
This manual refers to those mouse button and keyboard bindings in a general way. Refer to the following tables to find out the button names for the computer you are using to run the debugger. Mouse Button Bindings Generic Button Name HP 9000 Sun SPARCsystem command select left right...
Some values displayed on your screen may vary from the values shown here. The exercises and displays in this chapter were made using a HP 64747 40 MHz 68030/EC030 emulator. If you are using an emulator with a different clock rate or the HP 64748 68020 emulator, the information displayed in some windows on your screen will be different.
5 If the debugger software is installed on a different kind of computer than the computer you are using, edit the "platformScheme" in the /usr/hp64000/demo/debug_env/hp64747/Xdefaults.demo or /usr/hp64000/demo/debug_env/hp64748/Xdefaults.demo file. For example, if you are sitting at a Sun workstation which is networked to an HP 9000 Series 300 workstation, change the platformScheme to "SunOS".
Chapter 1: Getting Started with the Graphical Interface To start the debugger To start the debugger 1 Change to the debugger demo directory: cd /usr/hp64000/demo/debug_env/ <emulator> where < emulator> is hp64747 for a 68030 or 68EC030 emulator, or hp64748 for a 68020 emulator. 2 Start the debugger by entering: Startdebug emul68k This will set some environment variables, start the debugger, load a...
Page 38
Chapter 1: Getting Started with the Graphical Interface To start the debugger This command starts the debugger, which executes the command file mycmd.com and loads the absolute file ecs.x. See the “Loading and Executing Programs” chapter for more details.
Chapter 1: Getting Started with the Graphical Interface To run until main() To run until main() 1 Click on the Run Til () action key. The Code window now shows the main () routine. Clicking on the Run Til () action key runs the program until the line indicated by the contents of the entry buffer.
Chapter 1: Getting Started with the Graphical Interface To scroll the Code window To scroll the Code window To see more of the program you can: • Use the mouse to operate the vertical scroll bar: • Use the mouse to operate the horizontal scrolling buttons: •...
Chapter 1: Getting Started with the Graphical Interface To display a function To display a function 1 Position the cursor over the call to init_system. 2 Click the left mouse button. This will place the string "init_system" into the entry buffer. 3 Click on the Disp Src () action key.
Chapter 1: Getting Started with the Graphical Interface To run until a line To run until a line 1 Position the cursor over line 34. The hand-shaped cursor means that a pop-up menu is available. 2 Hold down the right mouse button to display the Code window pop-up menu. Move the mouse to Run until, then release the button.
Chapter 1: Getting Started with the Graphical Interface To edit the program To edit the program This step assumes you are using an HP Advanced Cross Language System compiler (HP B1461/HP B1478). If you are using another compiler, skip this step.
Chapter 1: Getting Started with the Graphical Interface To display init_system() again 3 Change the "73" to "74". 4 Exit the editor. 5 Click on the Make action key. The program will be re-compiled with the new value and reloaded into the emulator.
Chapter 1: Getting Started with the Graphical Interface To run until the breakpoint To run until the breakpoint • Click on the Run Xfer action key to run the program from its transfer address. While the program is executing, the menus and buttons are "grayed out," and an "hourglass"...
Chapter 1: Getting Started with the Graphical Interface To patch code using a macro To patch code using a macro 1 Position the cursor over line 38. 2 Select Attach macro from the Code window pop-up menu. The Macro Operations dialog box appears. The macro "patch_temp" is already selected.
Page 48
Chapter 1: Getting Started with the Graphical Interface To patch code using a macro Debugger Macro Add int patch_temp() /* set the current_temp to be 71 degrees instead of what the code says */ current_temp = 71; /* Restart execution at line # 39 -- Skips over the code too!! $Memory Register @PC = #39$;...
Chapter 1: Getting Started with the Graphical Interface To delete a single breakpoint Notice that current_temp, as shown in the Monitor window, is 71, not 68. To delete a single breakpoint Once you set a breakpoint, program execution will break each time the breakpoint is encountered.
Chapter 1: Getting Started with the Graphical Interface To step through a program To step through a program You can execute one source line (high-level mode) or one instruction (assembly-level mode) at a time by stepping through the program. • Click on the Step action key a few times. •...
Chapter 1: Getting Started with the Graphical Interface To step over functions To step over functions You can either step through functions or step over functions. When you step over a function, it is executed as a single program step. •...
Chapter 1: Getting Started with the Graphical Interface To change the value of a variable To change the value of a variable 1 In the entry buffer, add "= 10" after "num_checks". 2 Click on the C Expr () action key. The new value is displayed in the Journal window and in the Monitor window.
Chapter 1: Getting Started with the Graphical Interface To recall an entry buffer value To recall an entry buffer value 1 Click on the Recall button. 2 In the Recall dialog box, click the left mouse button on "num_checks". 3 In the Recall dialog box, click the left mouse button on OK. The string "num_checks"...
Chapter 1: Getting Started with the Graphical Interface To display the address of a variable To display the address of a variable You can use the C address operator (&) to display the address of a program variable. 1 Position the mouse pointer in the entry buffer. 2 Type "&"...
Chapter 1: Getting Started with the Graphical Interface To break on an access to a variable To break on an access to a variable If you started the debugger using the Startall script, skip this section. Access breakpoints are disabled because the analyzer has been configured to use the Trig2 trigger for other purposes.
Chapter 1: Getting Started with the Graphical Interface To use the command line To use the command line 1 Select Settings→Command Line from the menu bar. The command line area which appears at the bottom of the debugger window can be used to enter complex commands using either the mouse or the keyboard.
Chapter 1: Getting Started with the Graphical Interface To turn the command line off To turn the command line off 1 Move the mouse pointer to the Status line. 2 Hold down the shift key and click the right mouse button. The shift-click operation selects the second item from a pop-up menu, which in this case is Command Line On/Off.
Chapter 1: Getting Started with the Graphical Interface To trace events following a procedure call To trace events following a procedure call 1 Position the mouse pointer over the call to update_system() on line 102. 2 Select Trace After from the Code window pop-up menu. 3 Run the program by clicking on the Run action key.
Chapter 1: Getting Started with the Graphical Interface To see on-line help To see on-line help 1 Select Help→General Topic ... 2 Select To Use Help, then click on the OK button. Spend a few minutes exploring the help topics, so that you can find them when you need them.
Chapter 1: Getting Started with the Graphical Interface To end the debugging session To end the debugging session • Use the command select mouse button to choose File→Exit→Released (all windows, release emulator). • Using the command line, enter: Debugger Quit Released The debug session is ended and your system prompt is displayed.
The Standard Interface At a Glance The debugger has a standard interface for several types of terminals, terminal emulators, and bitmapped displays. When using the standard interface, commands are entered from the keyboard. Display area Status line Command line Command tokens Command look ahead...
Page 63
Chapter 2: Getting Started with the Standard Interface Display area. Can show assembly level screen, high-level screen, simulated I/O screen, or user-defined screens. These screens contain windows that display code, variables, the stack, registers, breakpoints, etc. You can use the UP ARROW, DOWN ARROW, PAGE UP, and PAGE DOWN cursor keys to scroll or page up or down the information in the active window.
Some values displayed on your screen may vary from the values shown here. The exercises and displays in this chapter were made using a HP 64747 40 MHz 68030/EC030 emulator. If you are using an emulator with a different clock rate or the HP 64748 68020 emulator, the information displayed in some windows on your screen will be different.
Chapter 2: Getting Started with the Standard Interface To copy the demonstration files To copy the demonstration files Before you can run the demonstration program, you must copy the debugger demo files to a new subdirectory. Perform the following steps to make the subdirectory and copy the demo files into it.
Chapter 2: Getting Started with the Standard Interface To start the debugger To start the debugger • Start the debugger by entering: db68k -t -e emul68k -C Config -c cmdfiles/debug/Cmd_dbstart ecs020 The -t option starts the debugger’s standard interface. The -e emul68k option tells the debugger which emulator to use. If the logical name of your emulator is not emul68k, then use the name of your emulator or the emulator’s lan address instead of emul68k.
Chapter 2: Getting Started with the Standard Interface To enter commands To enter commands 1 Type the first letter of one of the command tokens listed below the command entry line. 2 Type the first letter of the next command token, if any. 3 Type any necessary parameters.
Chapter 2: Getting Started with the Standard Interface To display main() • Using the command line, enter the Window Active command. Try changing the active window a few times. Activate the Code window when you are done. To display main() •...
Chapter 2: Getting Started with the Standard Interface To set a breakpoint To set a breakpoint Suppose you want to execute up to the call to update_system(). To do this you could set a breakpoint at the statement "update_system()" and run the program.
Chapter 2: Getting Started with the Standard Interface To step through the program To step through the program You can execute one source line (high-level mode) or one instruction (assembly-level mode) at a time by stepping through the program. • Using the command line, enter: Program Step You can step again by just pressing <Return>.
Chapter 2: Getting Started with the Standard Interface To display variables in their declared type Program Run 2 Using the command line, enter: Breakpt Delete 1 The breakpoint window is displayed, showing the breakpoint has been deleted. To display variables in their declared type Whenever you specify a variable name without a C or debugger operator prefix, it is displayed in its declared type.
Chapter 2: Getting Started with the Standard Interface To use a C printf command To use a C printf command The Expression Printf command prints the formatted output of the command to the Journal window using C format parameters. This command permits type conversions, scaling, and positioning of output within the Journal window.
Chapter 2: Getting Started with the Standard Interface To display blocks of memory Try running the program (just press <Return>) a few more times to see where it stops. If the program had a pointer to the variable, it would stop there, too.
Chapter 2: Getting Started with the Standard Interface To monitor variables To monitor variables The Expression Monitor Value command allows you to monitor a variable’s value during execution of your program. • Using the command line, enter: Expression Monitor Value current_temp The value of current_temp is now displayed in the Monitor window.
Chapter 2: Getting Started with the Standard Interface To end the debugging session To end the debugging session • Enter: Debugger Quit Released The debug session is ended and your system prompt is displayed. The emulator is released so that other people can use it. This completes your introduction to the 68020/030 debugger.
Page 76
Chapter 2: Getting Started with the Standard Interface To end the debugging session...
Entering Debugger Commands How to enter debugger commands using the mouse or the keyboard.
Page 80
Entering Debugger Commands This chapter shows you how to enter debugger commands using the graphical interface or the standard interface. The tasks are grouped into the following sections: • Using menus, the entry buffer, and action keys. • Using the command line with the mouse. •...
Page 81
Chapter 3: Entering Debugger Commands Function Key Commands You can enter commonly used commands quickly and easily by pressing the function keys F1 through F8 on your keyboard. Function keys can be used in the graphical interface as well as the standard interface. The following table and figure describe the commands associated with the function keys.
Page 82
Chapter 3: Entering Debugger Commands Command Line Control Character Functions Press the control key <Ctrl> simultaneously with the B, C, E,F, G, L, Q, R, S, U, or \ keys to execute the operations listed in the following table. (The letter keys may be upper- or lower-case.) Command Line Control Character Functions Control...
Chapter 3: Entering Debugger Commands Using Menus, the Entry Buffer, and Action Keys Using Menus, the Entry Buffer, and Action Keys This section describes the tasks you perform when using the debugger’s graphical interface to enter commands. This section describes how to: •...
Chapter 3: Entering Debugger Commands Using Menus, the Entry Buffer, and Action Keys If you decide not to select a menu item, simply continue to hold the mouse button down, move the mouse pointer off of the menu, and release the mouse button.
• To initially display a pull-down menu, press and hold the menu select key (for example, the “Extend char” key on a HP 9000 keyboard) and then type the underlined character in the menu label on the menu bar. (For example, “f” for “File”.
Chapter 3: Entering Debugger Commands Using Menus, the Entry Buffer, and Action Keys policy is set to pointer. That just means that the window containing the mouse pointer receives the keyboard input. In addition to keyboard mnemonics, you can also specify keyboard accelerators which are keyboard shortcuts for selected menu items.
Chapter 3: Entering Debugger Commands Using Menus, the Entry Buffer, and Action Keys To use pop-up menu shortcuts • To choose the first item in a pop-up menu, click the right mouse button. • To choose the second item in a pop-up menu, hold down the < Shift> key and click the right mouse button.
Page 88
Chapter 3: Entering Debugger Commands Using Menus, the Entry Buffer, and Action Keys Note If you have several graphical interface windows connected to the emulator, then a copy-and-paste action in any window causes the text to appear in all entry buffers in all windows. That is because although there are several entry buffers being displayed, there is actually only one entry buffer, which is shared by all windows.
Chapter 3: Entering Debugger Commands Using Menus, the Entry Buffer, and Action Keys To recall entry buffer values 1 Position the mouse pointer over the Recall button just to the right of the entry buffer text area, and click the mouse button to bring up the Entry Buffer Value Selection dialog box.
Chapter 3: Entering Debugger Commands Using Menus, the Entry Buffer, and Action Keys To edit the entry buffer • To position the keyboard cursor, click the left mouse button or use the arrow keys. • To clear the entry buffer, type < Ctrl> -U. •...
Chapter 3: Entering Debugger Commands Using Menus, the Entry Buffer, and Action Keys 2 If necessary, reposition the keyboard cursor to the location where you want to paste the text. 3 If necessary, choose the insert or replace mode for the command entry area. 4 Click the middle mouse button to paste the text into the command line entry area at the current cursor position.
Chapter 3: Entering Debugger Commands Using Menus, the Entry Buffer, and Action Keys run, and step through the demo program. You’ll really appreciate action keys when you define and use your own. Action keys are defined by setting an X resource. Refer to the chapter “Setting X Resources”...
Page 93
Chapter 3: Entering Debugger Commands Using Menus, the Entry Buffer, and Action Keys • Dialog boxes can be moved around the screen and do not have to be positioned over the graphical interface window. • If you iconify the interface window, all dialog boxes are iconified along with the main window.
Page 94
Chapter 3: Entering Debugger Commands Using Menus, the Entry Buffer, and Action Keys Examples To use the File Selection dialog box: The file filter selects specific files. A list of filter-matching files from the current directory. A list of files previously accessed during the emulation session.
Page 95
Chapter 3: Entering Debugger Commands Using Menus, the Entry Buffer, and Action Keys To use the Directory Selection dialog box: Label informs you of the type of list displayed. A single click on a directory name from the list highlights the name and copies it to the text area.
Chapter 3: Entering Debugger Commands Using Menus, the Entry Buffer, and Action Keys To access help information 1 Display the Help Index by choosing Help→General Topic ... or Help→Command Line ..2 Choose a topic of interest from the Help Index. The Help Index lists topics covering operation of the interface as well other information about the interface.
Chapter 3: Entering Debugger Commands Using the Command Line with the Mouse Using the Command Line with the Mouse When using the graphical interface, the command line portion of the interface gives you the option of entering commands in the same manner as they are entered in the standard interface.
Chapter 3: Entering Debugger Commands Using the Command Line with the Mouse To turn the command line on or off • To turn the command line on or off using the pull-down menu, choose Settings→Command Line. • To turn the command line on or off using the status line pop-up menu: position the mouse pointer within the status line area, press and hold the right mouse button, and choose Command Line On/Off from the menu.
Chapter 3: Entering Debugger Commands Using the Command Line with the Mouse To enter a command 1 Build a command using the command token pushbuttons by successively positioning the mouse pointer on a pushbutton and clicking the left mouse button until a complete command is formed. 2 Execute the completed command by clicking the Return pushbutton (found near the bottom of the command line in the “Command”...
Chapter 3: Entering Debugger Commands Using the Command Line with the Mouse To edit the command line using the command line pushbuttons • To clear the command line, click the Clear pushbutton. • To clear the command line from the cursor position to the end of the line, click the Clear to end pushbutton.
Chapter 3: Entering Debugger Commands Using the Command Line with the Mouse To edit the command line using the command line pop-up menu • To clear the command line: position the mouse pointer within the Command Line entry area; press and hold the right mouse button until the Command Line pop-up menu appears;...
Chapter 3: Entering Debugger Commands Using the Command Line with the Mouse contents of the Command Recall dialog box is not restricted to commands entered directly into the command line entry area. The Command Recall dialog box contains a list of interface commands executed during the debugger session as well as any predefined commands present at interface startup.
Chapter 3: Entering Debugger Commands Using the Command Line with the Keyboard Using the Command Line with the Keyboard Commands are entered on the command line at the debugger prompt (> ) and executed by pressing the < Return> key. Command tokens are entered by typing a single letter, typically the first uppercase letter of the token.
Page 104
Chapter 3: Entering Debugger Commands Using the Command Line with the Keyboard To enter a command keyword, type the first letter of the keyword. For example, to enter the command Debugger L evel Assembly, type the letters D, L, and A. The following command will appear on the command line: Debugger Level Assembly Press <...
Chapter 3: Entering Debugger Commands Using the Command Line with the Keyboard To edit the command line • To clear the command line, press < Ctrl> U. • To clear the command line from the cursor position to the end of the line, press <...
Chapter 3: Entering Debugger Commands Using the Command Line with the Keyboard list. Finally, you cannot predefine entries for the recall list — the list only contains the most recent commands executed during the emulation session. To display the help window •...
Page 107
Chapter 3: Entering Debugger Commands Using the Command Line with the Keyboard The cursor will be positioned at the Window Active command entry. Then you can use the cursor keys to select the window command you need help with and press <...
Chapter 3: Entering Debugger Commands Viewing Debugger Status Viewing Debugger Status The status line shows you what the debugger is doing. The status line: • Contains information about the operation being performed by the debugger. • Contains indicators to warn you about special conditions. •...
Chapter 3: Entering Debugger Commands Viewing Debugger Status Macro The debugger is executing a macro. Output The debugger is writing data to an output port. Paused The debugger is in the paused state after execution of the Debugger Pause command. Reading The debugger is reading an executable file or a C source file into the debugger’s memory.
Chapter 3: Entering Debugger Commands Viewing Debugger Status Last Breakpoint The BREAK # entry indicates the number of the last breakpoint that occurred, or (0) zero if execution was not terminated with a breakpoint. Trace Status The TRC:< Trc_status> entry indicates the status of the trace measurement function.
If you are using mwm to redefine your mouse buttons, delete the redefinition from your .mwmrc file. If you are using an older window manager such as mwm, look in /usr/hp64000/lib/X11/HP64_schemes/HP-UX/Debug.Input Copy the line HP64_Debug*whichButton: Button5 to your .Xdefaults file. Change the 5 to a 3.
Note Do not use the –h option when compiling and linking your program for the debugger. The –h option causes the compiler to generate HP 64000 file formats. Use the default settings which generate executable files in the HP-MRI IEEE-695 file format required by the debugger. The debugger extracts all symbolic information from the executable (.x) file.
Page 115
Chapter 4: Loading and Executing Programs Compiling Programs for the Debugger Using Optimizing Modes If you use the optimizing modes (–O or –OT), function calls that do not have automatic variables will not have stack frames. As a result, the stack backtrace window will not contain entries for such functions.
Compiler Reference describes the environment dependent routines supplied with the compiler. Using Microtec Language Tools The debugger is designed to work with the HP Advanced Cross Language System. However, you can also use the Microtec Research, Inc. language tools with the debugger.
Page 117
Use the command line flag "-fd’ with asm68k to generate local symbols. The HP assembler places global symbols in the debug part by default. There is no way to do this with Microtec’s asm68k. This information is needed by emul700/SRU to correctly scope symbols.
Chapter 4: Loading and Executing Programs Loading Programs and Symbols Loading Programs and Symbols This section shows you how to: • Specify the location of C source files. • Load programs. • Load programs only (without symbols). • Load symbols only (without the program). •...
Chapter 4: Loading and Executing Programs Loading Programs and Symbols HP64_DEBUG_PATH=/users/proj/src:/users/proj/mysrc:% export HP64_DEBUG_PATH causes the debugger to search paths for C source files in the following order: /users/proj/src /users/proj/mysrc the paths specified in the absolute file at compile time If you use the csh shell (most Sun systems), use setenv instead of export to set the variable.
Chapter 4: Loading and Executing Programs Loading Programs and Symbols Loads the new executable module. Absolute files contain executable object code. They must have a file name extension of .x. You do not need to specify the .x file extension when entering the absolute file name.
Chapter 4: Loading and Executing Programs Loading Programs and Symbols To load symbols only • Use the -I option to the db68k command when starting the debugger. $ db68k -e emul68k -I <absolute_file> <RETURN> • Select File→Load→Symbols Only ..., then use the File Selection dialog box to select the absolute file.
Chapter 4: Loading and Executing Programs Loading Programs and Symbols Code_Only only code from the absolute file is loaded. Symbols_Only only symbols from the absolute file are loaded. Pc_Set the program counter (PC) is set to the transfer address found in the absolute file. No_Pc_Set the program counter (PC) is not changed.
Page 123
Chapter 4: Loading and Executing Programs Loading Programs and Symbols underscores stripped depending on whether they were defined/referenced in a C or assembly source module. Examples To specify demand loading of symbols when starting the debugger: $ db68k -e emul68k -d <RETURN>...
Chapter 4: Loading and Executing Programs Stepping Through and Running Programs Stepping Through and Running Programs The various Program Run command options can be combined to make complex run-time control commands for your program. This section shows you how to: •...
Note If the debugger steps into an HP library routine, run until the stack level above the level of the library routine. Use the Program Run Until command or the Backtrace window pop-up menu.
Chapter 4: Loading and Executing Programs Stepping Through and Running Programs You can also use function key F8 to step over functions. To run from the current PC address • Click on the Run action key. • Select Execution→Run→from PC. •...
Chapter 4: Loading and Executing Programs Stepping Through and Running Programs 2 Select Execution→Run→from (). • Using the command line, enter: Program Run From <start_addr> Type in the start address, and press the < Return> key. The program runs until: •...
Page 128
Chapter 4: Loading and Executing Programs Stepping Through and Running Programs The break address (< break_address> ) acts as a temporary instruction breakpoint. It is automatically cleared when program execution is halted. The pass count (< pass_count> ) parameter specifies the number of times the break address is executed before the program is halted.
Chapter 4: Loading and Executing Programs Using Breakpoints Using Breakpoints The debugger implements access, read, and write breakpoints using analyzer hardware. The debugger implements instruction breakpoints using software breakpoints. This section shows you how to: • Set a memory access breakpoint (read, write, or either). •...
Page 130
Chapter 4: Loading and Executing Programs Using Breakpoints Access breakpoints cause the debugger to halt program execution each time the target program reads from or writes to the specified memory location(s). Memory locations can contain code or data. The debugger uses the emulation analyzer to implement access breakpoints. The analysis hardware has eight single break resources and one range break resource.
Chapter 4: Loading and Executing Programs Using Breakpoints Examples To cause execution to halt each time the program reads from or writes to the variable current_temp: Breakpt Access ¤t_temp To cause execution to halt each time the program reads from the variable current_temp: Breakpt Read ¤t_temp To cause execution to halt each time the program writes to the variable...
Page 132
Chapter 4: Loading and Executing Programs Using Breakpoints specified memory location(s). The debugger halts program execution before the program executes the instruction at the breakpoint address. If you specify a range, the debugger sets breakpoints on the first byte of each instruction within the specified range.
Chapter 4: Loading and Executing Programs Using Breakpoints Note Setting an instruction breakpoint in a memory area mapped as emulation ROM is allowed because the debugger can write to emulation ROM addresses. Setting an instruction breakpoint in a memory area mapped as target ROM is allowed if you answer no to the configuration question Break processor on write to ROM?.
Chapter 4: Loading and Executing Programs Using Breakpoints To set a breakpoint for overloaded C+ + functions • To set a breakpoint at one of the functions when you know the argument type, supply the argument type following the function name. •...
Chapter 4: Loading and Executing Programs Using Breakpoints To clear selected breakpoints • Position the mouse pointer in the Code window over the line at which you wish to clear a breakpoint. Click the right mouse button. • Position the mouse pointer in the Code window over the line at which you wish to clear a breakpoint.
Chapter 4: Loading and Executing Programs Using Breakpoints Examples To delete breakpoint number 1: Breakpt Delete 1 To clear all breakpoints • Select Breakpoints→Delete All. • Select Delete All Breakpoints from the Breakpoints window pop-up menu. • Using the command line, enter: Breakpt Clear_All And press the <...
Page 137
Chapter 4: Loading and Executing Programs Using Breakpoints The debugger displays the breakpoint window when: • You enter a breakpoint command. • You execute the Window Active Breakpoint command. • You use function keys F1/F2 to activate next/previous windows. The Breakpoint window temporarily overlays the top portion of the screen. When made active, this window displays breakpoint information including: •...
Page 138
Chapter 4: Loading and Executing Programs Using Breakpoints Line number The line number entry (LINE) displays a module line number if you set a breakpoint in a high-level module. If the compiler did not generate executable code for the C statement at the line number specified, the debugger examines the source code and sets a breakpoint on the next line number for which the compiler generated executable code.
Chapter 4: Loading and Executing Programs Using Breakpoints To halt program execution on return to a stack level • Select Run Until Stack Level from the Backtrace window pop-up menu. 1 Set a stack level breakpoint. 2 Run the program. 3 If desired, delete the breakpoint that was just encountered.
Chapter 4: Loading and Executing Programs Restarting Programs Restarting Programs This section shows you how to: • Reset the processor. • Reset the program counter to the starting address. • Reset program variables. To reset the processor • Select Execution→Reset to Monitor. •...
Chapter 4: Loading and Executing Programs Restarting Programs • Using the command line, enter: Program Pc_Reset And press the < Return> key. The program counter is reset to the transfer address of your absolute file. The next Program Run or Program Step command entered without a from address will restart program execution at the beginning of the program.
Chapter 4: Loading and Executing Programs Loading a Saved CPU State Loading a Saved CPU State State files are used to save the current CPU state (memory image and register values) of a debug session. Though state files can only be created from within a debugger/simulator session, you can use them to restore a CPU state in either a debugger/simulator or debugger/emulator session.
Page 143
Chapter 4: Loading and Executing Programs Loading a Saved CPU State If your program uses simulated I/O, it may not function properly on entering the debugger/emulator because the simulated I/O initialization may not have occurred. Examples To restore memory contents and register values saved in save file "session1.sav": Debugger Execution Load_State session1...
The debugger interface can use the deMMUer to translate physical addresses to logical addresses. Your HP emulator and analyzer can give you complete support for a static memory management system, and partial support for a non-paged, dynamic memory management system.
Chapter 4: Loading and Executing Programs Using the MC68030 Memory Management Unit To enable the MMU 1 Make sure that the tranlation tables are valid. These translation tables must be set up by your target system software. 2 Enable the MMU in the emulator by answering the "Enable the MMU?" question in the emulator configuration or by loading the translation control register.
Chapter 4: Loading and Executing Programs Accessing the UNIX Operating System Accessing the UNIX Operating System This section shows you how to: • Fork a UNIX shell. • Execute a UNIX command. To fork a UNIX shell • Select File→Term. A terminal emulation window will be created.
Chapter 4: Loading and Executing Programs Accessing the UNIX Operating System To execute a UNIX command • Using the command line, enter: Debugger Host_Shell Type in the UNIX command, and press the < Return> key. When using the graphical interface, a terminal emulation window will be opened and the UNIX command will be executed in that window (as specified by the “shellCommand”...
Chapter 4: Loading and Executing Programs Using the Debugger and the Emulator Interface Using the Debugger and the Emulator Interface The debugger and the emulator interface can use the emulator hardware at the same time. You should be aware of a few inconsistencies between the emulator and the debugger interfaces: •...
Chapter 4: Loading and Executing Programs Using simulator and emulator debugger products together Using simulator and emulator debugger products together You can continue a debugging session started in the debugger/simulator in the debugger/emulator by following the steps listed below: 1 In the debugger/simulator, use the Debugger Execution Save_State command to save the current memory contents and register values.
The BBA preprocessor (-b option) must be used at compile time in order for this information to exist in program memory. Once this information has been unloaded, it can be formatted with the BBA report generator, bbarep (see the HP Branch Validator for AxL S C User’s Guide).
Page 151
Chapter 4: Loading and Executing Programs Using the Debugger with the Branch Validator Note The Unload_BBA command is disabled when the debugger option Demand_Load is On. If Demand_Load is oFF but the program was loaded with Demand_Load On, the Memory Unload_BBA command will generate a BBA file with incomplete information.
Page 152
Chapter 4: Loading and Executing Programs Using the Debugger with the Branch Validator...
Chapter 5: Viewing Code and Data To add a symbol to the symbol table Using Symbols This section shows you how to: • Add a symbol to the symbol table. • Display symbols. • Delete a symbol from the symbol table. To add a symbol to the symbol table •...
Chapter 5: Viewing Code and Data To display symbols To display symbols • Select Display→Symbols→ to display information about the symbol in the entry buffer. • Using the command line, enter: Symbol Display Default Enter the symbol, module, or function name; then, press the < Return> key. Symbols and associated information are displayed in the journal window.
Chapter 5: Viewing Code and Data To display symbols in all modules Address = 00001436 thru 00001513 update_state_of\refresh : Type is Local int. Address = Frame + 8 update_state_of\interval_complete : Type is Local int. Address = Frame + 12 To display symbols in all modules •...
Page 157
Chapter 5: Viewing Code and Data To delete a symbol from the symbol table To delete all symbols in module ’updateSys’: Symbol Remove updateSys\ To delete all symbols in all modules: Symbol Remove \...
Chapter 5: Viewing Code and Data To delete a symbol from the symbol table Displaying Screens A debugger screen is what you see in the display area. Each debugger screen may contain one or more debugger windows. A debugger window is a predefined physical area on the screen containing specific debugger information.
Page 159
Chapter 5: Viewing Code and Data To delete a symbol from the symbol table • view The high-level screen displays high-level source code and stack backtrace information including the calling sequence of functions and function nesting levels. Assembly-Level Screen The debugger automatically displays the assembly-level screen when an executable (.x) file is loaded from within the debugger or the executable file does not contain the C source function main().
Chapter 5: Viewing Code and Data To display the high-level screen To display the high-level screen • Select Settings→High Level Debug. • Using the command line, enter: Window Screen_On High_Level To display the assembly level screen • Select Settings→Assembly Level Debug. •...
Chapter 5: Viewing Code and Data To display the standard I/O screen • Using the command line, enter: Debugger Level You can also use the Window New and the Window Active commands to display a different screen. To display the standard I/O screen •...
Page 162
Chapter 5: Viewing Code and Data To display the next screen (activate a screen) • Using the command line, enter: Window Screen_On Next The next higher-numbered screen will be displayed. Either the high-level or the assembly-level screen will be displayed, not both. The debugger screens are numbered as follows: Screen Name Screen Number...
Chapter 5: Viewing Code and Data To display the next screen (activate a screen) Displaying Windows This section shows you how to: • Change the active window. • Select the alternate view of a window. • Set the cursor position for a window. A debugger window is a predefined physical area on the screen.
Page 164
Chapter 5: Viewing Code and Data To display the next screen (activate a screen) Window Name Window Screen Number Number journal (high–level) code (high–level) monitor (high–level) backtrace status (high–level) journal (assembly–level) code (assembly–level) monitor (assembly–level) register (assembly–level) stack status (assembly–level) standard I/O view 1, 2, 3...
Chapter 5: Viewing Code and Data To change the active window To change the active window • Use the command select mouse button to click on the border of the window you wish to activate. • Select the window you want to make active from the Window→ menu. •...
Chapter 5: Viewing Code and Data To select the alternate view of a window To make user window 57 active: Window Active User_Window 57 To select the alternate view of a window • Click on the border of the active window with the command select mouse button.
Chapter 5: Viewing Code and Data To view information in the active window To view information in the active window • Use the scroll bar. • Use the cursor control keys. Press the < Up> or < Down> cursor key to move up or down in the window one line at a time.
Chapter 5: Viewing Code and Data To view information in the "More" lists mode Description → Move to right in data field of command. Highlight token to the right in status line window. ← Move to left in data field of command. Highlight token to the left in status line window.
Chapter 5: Viewing Code and Data To copy window contents to a file • Press the space bar to display the next screen of information. • Press the < Return> key to display the next line. • Press "Q" to end the "More" display. If you try to enter a command while the debugger is displaying the "--More--"...
Chapter 5: Viewing Code and Data To display C source code Displaying C Source Code This section shows you how to: • Display the C source code. • Find first occurrence of a string. • Find next occurrence of a string. To display C source code 1 Display the high-level screen (see the instructions in the previous “Displaying Screens”...
Chapter 5: Viewing Code and Data To find first occurrence of a string Program Display_Source cfunc (float) To find first occurrence of a string 1 Display the high-level screen (see the instructions in the previous “Displaying Screens” section). 2 Enter the string in the entry buffer. 3 Select Display→Source Find Fwd () or Display→Source Find Back ().
Page 172
Chapter 5: Viewing Code and Data To find next occurrence of a string • Using the command line, enter: Program Find_Source Next <Direction> Select either Forward or Backward as the direction, and press the < Return> key. Example To find the next occurrence of a string: Program Find_Source Next Forward...
Chapter 5: Viewing Code and Data To display assembly code Displaying Disassembled Assembly Code Coprocessor Support External devices must be supported by your target system. No support is provided by the debugger/emulator. 68881/68882 Floating-Point Unit. The debugger does not disassemble the 68881 FPU instruction set.
Chapter 5: Viewing Code and Data To set current module and function scope Displaying Program Context This section shows you how to: • Set current module and function scope. • Display current module and function. • Display debugger status. • Display register contents.
Chapter 5: Viewing Code and Data To display current module and function Program Context Set updateSys To select function “updateSys\paint_display” as the current function: Program Context Set updateSys\paint_display To set the program context to the module at which the program counter is pointing: Program Context Set To display current module and function...
Chapter 5: Viewing Code and Data To display register contents • Using the command line, enter: Debugger Execution Display_Status The following information is displayed in the view window (which temporarily overlays the top portion of the screen): • Product version. •...
Chapter 5: Viewing Code and Data To display the function calling chain (stack backtrace) • Select Modify→Registers. • Using the command line, enter: Window Active Assembly Registers The register window shows the current values of the microprocessor’s registers and several debugger variables. The microprocessor register values are labeled with their standard names.
Page 178
Chapter 5: Viewing Code and Data To display the function calling chain (stack backtrace) The backtrace window displays the function calling chain, from the compiler startup routine to the current function in high-level mode. This window displays (from left to right): •...
Page 179
Chapter 5: Viewing Code and Data To display the function calling chain (stack backtrace) Character Description Space The debugger is executing within a function. The program counter is at a label. Typically, this is an assembly language function point. The function has been entered, but the function prolog has not been executed.
Page 180
Chapter 5: Viewing Code and Data To display the function calling chain (stack backtrace) Nesting level 1. When program execution breaks on an address that has an associated public label (for example, a function entry point), nesting level 1 information is based on the processor SP.
Chapter 5: Viewing Code and Data To display all local variables of a function at the specified stack (backtrace) level frame. Additionally, there is no function name associated with the frame, i.e., it is displayed as < unknown> . To display all local variables of a function at the specified stack (backtrace) level •...
Chapter 5: Viewing Code and Data To display the address of the C+ + object invoking a member function To display the address of the C+ + object invoking a member function • Display the value of the function’s this pointer. If the program has stopped at a function, you can find out the address of the object which invoked the function.
Chapter 5: Viewing Code and Data To calculate the value of a C expression Using Expressions This section shows you how to: • Calculate the value of a C expression. • Display the value of an expression or variable. • Monitor variables.
Chapter 5: Viewing Code and Data To display the value of an expression or variable Expression C_Expression time Result is: data address 000091DC {time_struct} To calculate the value of member ’hours’ of structure ’time’: Expression C_Expression time->hours Result is: 4 0x04 To assign the value 1 to ’system_is_running’: Expression C_Expression system_is_running = 1...
Chapter 5: Viewing Code and Data To display members of a structure To display the address of the variable ’system_is_running’: Expression Display_Value &system_is_running 000091F0 To display the address of the C structure ’time’: Expression Display_Value time 000091DC To display the values of the members of structure ’time’: Expression Display_Value *time hours minutes...
Chapter 5: Viewing Code and Data To display the members of a C+ + class Example To display the names of the members of structure astruct, use the following expression in the entry buffer: *astruct The * operator tells the debugger to display the members of the structure, rather than the address of the structure.
Chapter 5: Viewing Code and Data To monitor variables • Using the command line, enter: Expression Display_Value < object > Remember, you are displaying the values in an object, so you need to run the program to the point where the object is created. To display the members of a class, see "To display the members of a C+ + class."...
Chapter 5: Viewing Code and Data To monitor the value of a register Variables in the monitor window are updated each time the debugger stops executing the program. (The program is not considered to be "stopped" when a breakpoint with an attached macro is encountered.) Example To monitor the value of variable ’current_temp’: Expression Monitor Value current_temp...
Chapter 5: Viewing Code and Data To discontinue monitoring all variables The variable is removed from the monitor window. Example To stop monitoring variable 2 in the monitor window: Expression Monitor Delete 2 To discontinue monitoring all variables • Select Delete All Variables in the Monitor window pop-up menu. •...
Chapter 5: Viewing Code and Data To print formatted output to a window To print formatted output to a window • Using the command line, enter: Expression Fprintf Enter the number of the user-defined window, the format string (enclosed in quotes), and the arguments;...
Page 191
Chapter 5: Viewing Code and Data To print formatted output to journal windows Enter the format string (enclosed in quotes) and the arguments; then, press the < Return> key. The formatted output is written to the journal window. This command is similar to the C printf function.
Chapter 5: Viewing Code and Data To compare two blocks of memory Viewing Memory Contents This sections explains how to to view, compare, and search blocks of memory. To compare two blocks of memory • Using the command line, enter: Memory Block_Operation Match <Mismatch_Operation>...
Chapter 5: Viewing Code and Data To examine a memory area for invalid values address range and the value that is to be searched for, and press the < Return> key. Example To search for the expression ’gh’ in the memory range from address 1000h through address 10ffh and stop when the expression is found or address 10ffh is reached: Memory Block_Operation Search Word Once...
Chapter 5: Viewing Code and Data To display memory contents To display memory contents • Select Display→Memory→. • Using the command line, enter: Memory Display <Format> Select either Mnemonic, Byte, Word, or Long as the format in which memory contents are to be displayed. If you are using the command line, enter the starting address or the address range of the memory whose contents are to be displayed, and press the <...
Your programs can use SIMIO by means of the I/O libraries and environment dependent routines provided with the HP B1461/HP B1478 C Cross Compiler. Your programs use the library functions when they open, close, read, or write to files, etc.
The debugger supports only one Control Address (CA) for doing SIMIO operations. This buffer is named systemio_buf in the HP B1461/HP B1478 C I/O libraries. Assembly code users who want to use SIMIO with the debugger must label their Control Address as _systemio_buf (the compiler prefixes symbols with an underscore).
Chapter 5: Viewing Code and Data To display memory contents protocol. When opening a stream on an UNIX file, SIMIO supports the same control parameters for file creation and blocking I/O that are available to host programs. UNIX Processes UNIX processes can be run as subprocesses to the debugger with their input and output directed to the user program.
Chapter 5: Viewing Code and Data To enable simulated I/O stdout This name will be replaced by the name stored in the stdout_name. This name is set via the Stdio_Redirect command. stderr This name will be replaced by the name stored in the stderr_name. This name is set via the Stdio_Redirect command.
Chapter 5: Viewing Code and Data To disable simulated I/O To disable simulated I/O • Using the command line, enter: Debugger Execution IO_System Disable To set the keyboard I/O mode to cooked • Using the command line, enter: Debugger Execution IO_System Mode Cooked In the Cooked mode, the keyboard input is processed.
Chapter 5: Viewing Code and Data To control blocking of reads program. The only special character that cannot be sent to the target program is < Ctrl> -C which is used to interrupt the debugger’s execution of the program. See also "To set the keyboard I/O mode to cooked"...
Chapter 5: Viewing Code and Data To redirect I/O This causes the debugger to interpret any further keyboard reads as being at the end of file. In cooked mode, pressing < Ctrl> -D is equivalent to entering the Debugger Execution IO_System Keyboard_EOF command. To redirect I/O To redirect the three I/O streams and to reset your program to the startup address, perform the following steps.
Chapter 5: Viewing Code and Data To check resource usage The translation name contains the name of a file to use when the target requests opening of any of these stdio streams. By default, stdin_name contains /dev/simio/keyboard (the keyboard), and translations stdout_name and stderr_name contain /dev/simio/display (the standard I/O (stdio) screen).
Chapter 5: Viewing Code and Data To increase file resources • 40 open files • 4 subprocesses To increase file resources 1 Change to directory 68020 or 68030 in path /usr/hp64000/include using the cd command. 2 Change the value of macro FOPEN_MAX from 12 to the new maximum number of open files (the limit is 40) in file stdio.h using an editor on your system.
Page 204
Chapter 5: Viewing Code and Data To increase file resources You can increase the simulated I/O file limit by modifying the startup code for your compiler. The code must be modified from the UNIX shell. The maximum number of open SIMIO files descriptors can be increased to 40. Caution Compiler startup files compiled with the modified stdio.h header file will run only in the debugger environment.
Chapter 5: Viewing Code and Data If problems occur when using simulated I/O If problems occur when using simulated I/O If the target program stops ("hangs") while reading from the keyboard with the O_NDEL AY flag set, or if programs do not appear to be getting proper input from the keyboard, check the keyboard mode setting.
Page 206
Chapter 5: Viewing Code and Data If problems occur when using simulated I/O...
Chapter 6: Making Trace Measurements This chapter shows you how to: • Start traces. • Stop traces. • Display traces. • Specify trace events. • Delete trace events. • Specify storage qualifiers. • Specify trigger conditions. • Halt program execution on the occurrence of a trigger. •...
Page 209
Chapter 6: Making Trace Measurements Default Trace Specification The default trigger condition is "never". You can make a default trace measurement by entering the Trace Again command. When you use the default trace condition, qualified bus cycles are collected continuously until you halt the measurement.
Page 210
Chapter 6: Making Trace Measurements Storage Qualification A storage qualifier defines which bus cycles will be stored when you make a trace measurement. You can specify that only cycles corresponding to certain values be stored in the trace buffer. These values can be addresses, a range of addresses, data values, status values (the type of bus activity), or an OR’ed combination of values.
Page 211
Chapter 6: Making Trace Measurements DataOK The trace buffer contains valid data. Halted The Trace Halt command was used to halt the trace. Idle No trace measurement has been executed during the current debug session. Setup A trace measurement has been set up (specified), and will start on the next program run or program step command.
Page 212
Chapter 6: Making Trace Measurements define a trace trigger while an access breakpoint is active. This will cause an error condition. Note The emulator user interface may specify a trace that overrides a debugger access breakpoint. The debugger interface will set up the access breakpoint trace when a run or step command is issued only if the analyzer is not currently in use.
Chapter 6: Making Trace Measurements To start a trace using the Code pop-up menu To start a trace using the Code pop-up menu 1 Position the mouse pointer over the line of code which should trigger the trace. 2 Hold down the right mouse button and select one of the Trace items from the Code window pop-up menu.
Chapter 6: Making Trace Measurements To stop a trace in progress The Trace Again command starts the trace using the last trace specification you set up or the default trace specification if you have not set up a trace in the current debug session.
Chapter 6: Making Trace Measurements To display a trace To display a trace • Select Window→Trace. • In the emulator/analyzer window, select Display→Trace. • Using the command line, enter: Trace Display And press the < Return> key. The default trace display shows the high-level program source lines corresponding to the trace states and entries and exits from modules.
Chapter 6: Making Trace Measurements To specify trace events To display the raw data starting with the trigger state in the trace window and cause the debugger to enter trace mode: Trace Display Lines 0 <Tab> Raw To exit trace mode, press the < Esc> key twice. This action returns the debugger to command mode where you can enter commands from the keyboard.
Chapter 6: Making Trace Measurements To delete trace events Trace Event Specify 3 <Tab> Address Is ¤t_humid <Tab> Status Is Write To delete trace events • Using the command line, enter: Trace Event Delete <event_nmbr> Enter the number of the event you wish to delete, and press the < Return> key.
Page 219
Chapter 6: Making Trace Measurements To specify storage qualifiers If you specify the Prestore function, the trace function stores the two instruction fetch bus cycles immediately preceding the qualified states being stored. Examples To store either of two events: Trace Event Specify 1 <Tab> Address Is update_state_of_system Trace Event Specify 3 <Tab>...
Chapter 6: Making Trace Measurements To specify trigger conditions To specify trigger conditions • Using the command line, enter: Trace Trigger Event <event_nmbr> Enter the number of the event previously defined with the Trace Event Specify command, and press the < Return> key. You can specify a single event, an OR’ed combination of events, a specified number of occurrences of a single event or an OR’ed combination of events, or a sequence of events (maximum of seven) in the trace trigger specification.
Chapter 6: Making Trace Measurements To halt program execution on the occurrence of a trigger Trace Trigger Event 1 <Tab> Then 3 Trigger on an OR’ed combination of events. To trigger on a call to function update_state_of_system or a write access to variable current_humid : Trace Event Specify 1 <Tab>...
Chapter 6: Making Trace Measurements To remove a storage qualification term To remove a storage qualification term • Using the command line, enter: Trace StoreQual None And press the < Return> key. This command restores the storage qualification to its default value, that is, all bus cycles will be stored in the trace buffer.
Chapter 6: Making Trace Measurements To trace code execution before and after entry into a function To trace code execution before and after entry into a function 1 Specify the trigger condition. Trace Trigger Address Is function_name <Tab> Status Is FnCde Prog PosnTrig Center 2 Run the program.
Chapter 6: Making Trace Measurements To trace data written to a variable and who wrote to the variable 3 Start program execution. 4 Complete the trace. The the TRC status on the status line will change to TRC:Trgrd to indicate that the first write has taken place.
Chapter 6: Making Trace Measurements To trace events leading up to writing a particular value in a variable 3 Start program execution. 4 Complete the trace. The the TRC status on the status line will change to TRC:Trgrd to indicate that the first write has taken place.
Chapter 6: Making Trace Measurements To execute a complex breakpoint using the trace function 3 Disable any storage qualification terms to cause the trace function to store all states. Trace StoreQual None 4 Start program execution and the trace. Program Run 5 When the trace is completed (the command line will contain the message TRC:Cmplt ), press CTRL C to halt program execution and enter command mode.
Chapter 6: Making Trace Measurements To trace entry to and exit from modules 3 Define the trace trigger as event 6 followed by event 7, and position the trigger at the center of the trace buffer so that states leading up to the trigger and following the trigger will be captured.
Page 228
Chapter 6: Making Trace Measurements To trace entry to and exit from modules The don’t care condition is specified by specifying a mask in the data specification. &= is the mask operator. This value corresponds to the LINK and UNLK instructions. 2 Define event 5 as the trace storage qualifier.
Chapter 6: Making Trace Measurements If tracing is not triggered as expected If tracing is not triggered as expected If you are using 16-bit memory, you need to make fetches appear to be on longword boundaries. Use the command line Debugger Option Trace Fetch_Align command to mask the fetch addresses.
Page 230
Chapter 6: Making Trace Measurements If tracing is not triggered as expected...
Chapter 7: Editing Code and Data Editing Code and Data How to use the debugger to make permanent or temporary changes to source code, memory contents, and registers.
Chapter 7: Editing Code and Data To edit source code from the Code window Editing Files The graphical interface gives you a number of context-dependent and context-independent editing commands. From several screens, you can bring up the source file that contains the source line or symbol you are viewing in the display.
Chapter 7: Editing Code and Data To edit an arbitrary file To edit an arbitrary file 1 Select File→Edit→File. 2 Using the file selection dialog box, enter the name of the file you wish to edit; then, click on the OK pushbutton. After editing the file, you quit the edit session by the standard method for the editor used.
Chapter 7: Editing Code and Data To change a variable using a C expression Patching Source Code When you change source code by editing the C source file, you need to re-compile. The debugger provides several ways to patch your program without re-compiling: •...
Chapter 7: Editing Code and Data To patch a line of code using a macro To patch a line of code using a macro 1 Set a breakpoint at the line you wish to patch. An easy way to set the breakpoint is to click the right mouse button on the line in the Code window.
Chapter 7: Editing Code and Data To patch C source code by inserting lines To patch C source code by inserting lines 1 Define a macro containing the inserted statements. The macro must provide a return value of 1 (true) in order for the program to continue after the macro is executed.
Page 237
Chapter 7: Editing Code and Data To patch C source code by deleting lines count = 5; for (i=0; i < MAXNUM; i++) array[i]=1; count=count+2; k=count*i; To delete lines 29 and 30, and insert a new line incrementing count by one, you could write the following macro: Debugger Macro Add patch_29() count++;...
Chapter 7: Editing Code and Data To change the value of one memory location Editing Memory Contents This section shows you how to: • Change memory location values. • Copy a block of memory. • Fill a block of memory with values. •...
Chapter 7: Editing Code and Data To copy a block of memory Memory Assign <Size> 2 Using the command line, select either Byte, Word, or Long as the size of the memory location, enter the address of the beginning of the block, and press the <...
Chapter 7: Editing Code and Data To fill a block of memory with values To fill a block of memory with values • Using the command line, enter: Memory Block_Operation Fill <Size> Select either Byte, Word, or Long as the size of the memory locations, enter the expression that assigns a value to locations in a range of addresses, and press the <...
Chapter 7: Editing Code and Data To re-initialize all program variables To re-initialize all program variables • Select File→Load→Program Only ..., then use the File Selection dialog box to select the absolute file. • Using the command line, enter: Program Load New Code_only No_Pc_Set <absolute_name> Enter the name of the absolute file whose code is to be loaded, and press the <...
Page 242
Chapter 7: Editing Code and Data To change the contents of a register Example To modify register values interactively: Memory Register The program counter (PC) is displayed in the journal window. You can modify the PC by entering a value (10a4h in this example) at the cursor prompt and pressing <...
Using Macros and Command Files How to use macros and command files to make debugging easier.
Page 244
Chapter 8: Using Macros and Command Files The debugger provides several ways for you to simplify tasks that you do often. • Macros are C-like functions. You can call macros individually, attach them to breakpoints, or automatically execute them with each program step.
Chapter 8: Using Macros and Command Files Using Macros Using Macros A macro is a C-like function consisting of debugger commands and C statements and expressions. Macros are most often used to: • Patch C source code. Often, bugs found with the debugger can be temporarily patched with C source statements in macros.
Page 246
Chapter 8: Using Macros and Command Files Using Macros This section shows you how to: • Define a macro. • Call a macro. • Stop a macro. • Display macro source code. • Patch C source code by using macros. •...
Page 247
Chapter 8: Using Macros and Command Files Using Macros Macro arguments You can use formal macro arguments throughout the macro definition. They are replaced at execution time by the actual parameters present in the macro call. The actual parameter is coerced to the corresponding formal parameter type.
Page 248
Chapter 8: Using Macros and Command Files Using Macros If a macro is executed while the PC is pointing into the function foo(), variables i, j, and k can be directly accessed. If this is not the case, i must be accessed with a module qualifier, such as init\i.
Chapter 8: Using Macros and Command Files Using Macros • File Command • Debugger Quit To display the Macro Operations dialog box • Select Breakpoints→Edit/Call Macro from the menu bar. • Select Attach Macro from the Code window pop-up menu. The Macro Operations dialog box allows you to call predefined macros, edit or call existing user-defined macros, and create new macros.
Chapter 8: Using Macros and Command Files Using Macros When you exit the editor, save the macro under the default name. If you save it under a different name, the macro may be lost. See Also See "To use an existing macro as a template for a new macro" if you want to use an existing macro as the basis for a new macro.
Chapter 8: Using Macros and Command Files Using Macros To define a macro interactively using the command line 1 Enter the Debugger Macro Add command followed by an optional return type, and then a macro name. The macro name must be followed by parentheses;...
Chapter 8: Using Macros and Command Files Using Macros To define a macro outside the debugger 1 Using a text editor on your host system, define the macro. 2 Save the macro definition in a command file (< filename> .com). 3 Start the debugger.
Chapter 8: Using Macros and Command Files Using Macros Remember to save the macro under the default file name when you leave the editor (use the "Z Z " or ":wq!" command in vi). To save macros • Select File→Store→User-Defined Macros..The File Selection dialog box will be displayed so that you can choose a file in which to save the macros.
Chapter 8: Using Macros and Command Files Using Macros If you need to access local program variables in a macro, pass them to the macro as parameters. To call a macro • Select Breakpoints→Edit/Call Macro ...→Call. • Using the command line, enter: Debugger Macro Call Enter the name of the macro to be called, and press the <...
Chapter 8: Using Macros and Command Files Using Macros To call a macro from within an expression • Enter a macro call as part of any expression entered on the command line of the debugger. The debugger will evaluate the macro and use its return value when evaluating the rest of the expression.
Chapter 8: Using Macros and Command Files Using Macros • The macro cannot call itself. Example If you have the following macro definition: Debugger Macro Add int ten_to_the(y) return power(10,y); } the macro will compute 10**y by calling the previously defined macro power(). To call a macro on execution of a breakpoint •...
Page 257
Chapter 8: Using Macros and Command Files Using Macros Example The following example shows how return values can be used to conditionally control a breakpoint. The example uses the Debugger Macro Add and Breakpt Write commands to define a breakpoint that occurs only when the target variable days becomes greater than 31.
Chapter 8: Using Macros and Command Files Using Macros To call a macro when stepping through programs • Select Execution→Step→with Macro ..• Using the command line, enter: Program Step With_Macro Enter the name of the macro to be called, and press the < Return> key. You can use the Program Step With_Macro command to execute a macro after the step occurs.
Chapter 8: Using Macros and Command Files Using Macros To stop a macro • Press < Ctrl> -C. Macros can be halted during execution by pressing < Ctrl> -C. Caution < Ctrl> -C will stop execution of a macro. Pressing < Ctrl> -C may interrupt a code-patching macro before it completes execution.
Chapter 8: Using Macros and Command Files Using Macros To delete a macro • Using the command line, enter: Symbol Remove <macro_name> Enter the name of the macro you want to delete, and press the < Return> key. Use the Breakpt Delete command to remove the breakpoint that called the macro.
Chapter 8: Using Macros and Command Files Using Command Files Using Command Files A command file is an ASCII file containing debugger commands. You can create command files from within the interface by logging commands to a command file as you execute the commands, or you can create or modify command files outside the interface with an ASCII text editor.
Chapter 8: Using Macros and Command Files Using Command Files To record commands • Use the -l command_file option to the db68k or db68030 command when starting the debugger. (The debugger appends the file extension .com to command_file.) $ db68k -e <emulator_id> -l <command_file> <RETURN> •...
Chapter 8: Using Macros and Command Files Using Command Files To place comments in a command file • Using the command line, enter: File Log Comment Enter the comment that should be placed in the command file, and press the <...
Chapter 8: Using Macros and Command Files Using Command Files To stop command recording • Select File→Log→Stop Command Recording. • Using the command line, enter: File Log oFF And press the < Return> key. The command file is closed. To run a command file •...
Chapter 8: Using Macros and Command Files Using Command Files The debugger will begin executing commands found in the command file as if those commands were entered directly into the interface. The debugger will continue to execute commands until it reaches the end of the file or, perhaps, until an error occurs, depending on the command file error handling mode (see “To set command file error handling”).
Chapter 8: Using Macros and Command Files Using Command Files To append commands to an existing command file • Using the command line, enter: File Log Append Enter the name of the file to which commands will be appended, and press the <...
Chapter 8: Using Macros and Command Files Using Command Files Journal files are similar to command files. They contain debugger commands entered during a debug session. Journal files also contain any output generated by debugger commands. Journal files contain everything that is written to the journal window during a debug session.
Chapter 8: Using Macros and Command Files Using Command Files After opening a file using the File User_Fopen Append or File User_Fopen Create command, you can use the Expression Fprintf command to write information to the file. Files opened for reading may be read from the built-in macro fgetc().
Chapter 8: Using Macros and Command Files Using Command Files To use the debugger in batch mode • Use the -b and -c command_file options to the db68k command when starting the debugger. When using the debugger in batch mode, stdin, stdout, and stderr are disabled. The -b option must be accompanied by the -c option and a debugger command file.
Page 270
Chapter 8: Using Macros and Command Files Using Command Files...
Chapter 9: Configuring the Debugger Configuring the Debugger How to change the appearance and behavior of the debugger.
Page 272
Chapter 9: Configuring the Debugger Configuring the debugger These tasks are grouped into the following sections: • Setting the general debugger options. • Setting the symbolics options. • Setting the display options. • Modifying display area windows. • Saving and loading the debugger configuration. •...
Chapter 9: Configuring the Debugger Setting the General Debugger Options Setting the General Debugger Options This section describes how to: • Display the Debugger Options dialog box. • List the debugger options settings. • Change debugger options settings. To display the Debugger Options dialog box •...
Chapter 9: Configuring the Debugger Setting the General Debugger Options Step_Speed Radix = Decimal_Input, Decimal_Output Stdio_Window = Swap Check_Args = oFF Align_Bp = oFF Breakpt_Window = Swap More = On Highlight = Inverse Frame_Stop = oFF Command_Echo = oFF View_Window = Swap Demand_Load = oFF...
Chapter 9: Configuring the Debugger Setting the General Debugger Options • Using the command line, enter: Debugger Option General Align_Bp Select On or oFF, and press the < Return> key. Debugger automatically aligns breakpoints or locations to be displayed in mnemonic format to the beginning of instructions.
Chapter 9: Configuring the Debugger Setting the General Debugger Options To specify demand loading of symbols • Using the command line, enter: Debugger Option General Demand_Load Select On or oFF, and press the < Return> key. Symbol information is loaded on an as-needed basis. All symbol information is loaded.
Chapter 9: Configuring the Debugger Setting the General Debugger Options To specify step speed • Using the command line, enter: Debugger Option General Step_Speed <numb 0..100> Enter the step speed number (from 0 to 100), and press the < Return> key. Higher numbers represent slower speeds.
Chapter 9: Configuring the Debugger Setting the Symbolics Options Setting the Symbolics Options This section shows you how to: • Display symbols in assembly code. • Display intermixed C source and assembly code. • Enable parameter checking in commands and macros. To display symbols in assembly code •...
Chapter 9: Configuring the Debugger Setting the Symbolics Options To display intermixed C source and assembly code • In the Debugger Options dialog box, click on the Intermixed Source/Assembly button to toggle source display. • Using the command line, enter: Debugger Option Symbolics Intermixed Select On or oFF, and press the <...
Page 280
Chapter 9: Configuring the Debugger Setting the Symbolics Options When an assignment is made, the debugger warns you if the assignment contains a C type mismatch. The debugger does not perform any argument checking.
Chapter 9: Configuring the Debugger Setting the Display Options Setting the Display Options This section shows you how to: • Specify the Breakpoint window display behavior. • Specify the View window display behavior. • Display half-bright or inverse video highlights. •...
Chapter 9: Configuring the Debugger Setting the Display Options To specify the View window display behavior • In the Debugger Options dialog box, hold the command select mouse button down on the View Window button. Release the button to select On or Swap. •...
Chapter 9: Configuring the Debugger Setting the Display Options The Stdio window is only displayed when function key F6 is pressed or when the Window Screen_On Stdio command is entered. Swap The Stdio window is displayed when a program writes to it and removed when the program returns to the command mode.
Chapter 9: Configuring the Debugger Setting the Display Options • Using the command line, enter: Debugger Option View More Select On or oFF, and press the < Return> key. Information is listed one screen at a time. Information is listed all at once. To specify scroll amount •...
Chapter 9: Configuring the Debugger Setting the Display Options Time Use half of trace memory to store timing information. Nothing Use all of trace memory to store bus states. To mask fetches while tracing • In the Debugger Options dialog box, select a Fetch Mask option. •...
Chapter 9: Configuring the Debugger Modifying Display Area Windows Modifying Display Area Windows You can reformat display-area screens by modifying their windows. For example, you can reformat the high-level screen by resizing and moving the high-level Code, Monitor, Backtrace, Journal, and Breakpoint windows. You can also resize and move the alternate view of these windows.
Chapter 9: Configuring the Debugger Modifying Display Area Windows The Window Resize command is used to move or alter the size of any existing window, except for the Status window. Use the Window New command to move the Status window. When you use the Window Resize command on the normal view of a window, the normal dimensions are modified.
Chapter 9: Configuring the Debugger Modifying Display Area Windows Window New 5 <tab> High_Level 0,0,3,78 To move the assembly-level Status window to the bottom of the display: Window New 15 <tab> Assembly 19,0,22,78 To define user screens and windows • Using the command line, enter: Window New Enter the window and screen parameters, and press the <...
Chapter 9: Configuring the Debugger Modifying Display Area Windows Examples To make a user window numbered 57 in user screen 4 with the upper-left corner of the window at coordinates 5,5 and the lower-right corner of the window at coordinates 18,78: Window New 57 <tab>...
Chapter 9: Configuring the Debugger Modifying Display Area Windows Examples To erase the contents of user window 57: Window Erase 57 To remove user-defined screens and windows • Using the command line, enter: Window Delete <user_window_nmbr> Enter the number of the window to be removed, and press the < Return> key. To remove a user-defined screen, remove all windows associated with that screen.
Chapter 9: Configuring the Debugger Saving and Loading the Debugger Configuration Saving and Loading the Debugger Configuration Information regarding debugger options and screen configurations can be saved in a startup file. Startup files can be created only from within the debugger.
Chapter 9: Configuring the Debugger Saving and Loading the Debugger Configuration When saving window and screen settings that have been customized for a particular type of terminal, name the startup file the same as the TERM environment variable setting. If no startup file is loaded when starting the debugger, the debugger will automatically search for startup files named “./$TERM.rc”...
Page 293
Chapter 9: Configuring the Debugger Saving and Loading the Debugger Configuration If no startup file is found, reasonable defaults will be used. Examples To start the debugger and load the state saved in the startup file “my_state.rc”: $ db68k -e emul68k -s my_state.rc <RETURN>...
Resources specifications in later files override those in earlier files. Files are read in the following order: The application defaults file. For example, /usr/lib/X11/app-defaults/HP64_Debug in HP-UX or /usr/openwin/lib/X11/app-defaults/HP64_Debug in SunOS. The $XAPPLRESDIR/HP64_Debug file. (The XAPPLRESDIR environment variable defines a directory containing system-wide custom application defaults.)
Page 295
Chapter 9: Configuring the Debugger Setting X Resources Resource specifications included in the command line with the -xrm option. System scheme files in directory /usr/hp64000/lib/X11/HP64_schemes. System-wide custom scheme files located in directory $XAPPLRESDIR/HP64_schemes. User-defined scheme files located in directory $HOME/.HP64_schemes (note the dot in the directory name).
X resources. The following tables describe some of the commonly modified application resources. Application Resources for Schemes Resource Values Description HP64_Debug.platformScheme HP-UX Names the subdirectory for platform SunOS specific schemes. This resource should be (custom) set to the platform on which the X server is running (and displaying the debugger’s...
Page 297
Chapter 9: Configuring the Debugger Setting X Resources Commonly Modified Application Resources Resource Values Description HP64_Debug.enableCmdline True Specifies whether the command line area False is displayed when you initially enter the debugger’s graphical interface. *editFile (example) Specifies the command used to edit files. vi %s *editFileLine (example)
Page 298
The HP64_Debug file contains the default definitions for the graphical interface application’s X resources. For example, on an HP 9000 computer you can use the following command to copy the complete HP64_Debug file to HP64_Debug.tmp (note that the HP64_Debug file is several hundred lines long): cp /usr/lib/X11/app-defaults/HP64_Debug HP64_Debug.tmp...
Page 299
!HP64_Debug.columns: Save your changes and exit the editor. 3 If the RESOURCE_MANAGER property exists (as is the case with HP VUE — if you’re not sure, you can check by entering the xrdb -query command), use the xrdb command to add the resources to the RESOURCE_MANAGER property.
3 Modify the $HOME/.HP64_schemes/< platform> /Debug.< scheme> file. For example, you could modify the “$HOME/.HP64_schemes/HP-UX/Debug.MyColor” file to change the defined foreground and background colors. Also, since the scheme file name is different than the default, you could comment out various resource settings to cause general foreground and background color definitions to apply to the debugger’s graphical interface.
Page 301
For example, to use the “$HOME/.HP64_schemes/HP-UX/Debug.MyColor” color scheme file you would set the “HP64_Debug.colorScheme” resource to “MyColor”: HP64_Debug.colorScheme: MyColor...
Chapter 9: Configuring the Debugger Setting X Resources To set up custom action keys • Modify the “actionKeysSub.keyDefs” resource. The “actionKeysSub.keyDefs” resource defines a list of paired strings. The first string defines the text that should appear on the action key pushbutton. The second string defines the command that should be sent to the command line area and executed when the action key is pushed.
Chapter 9: Configuring the Debugger Setting X Resources To set initial recall buffer values • Modify the “entries” resource for the particular recall buffer. Some of the resources for the pop-up recall buffers are listed in the following table: Pop-up Recall Buffer Resources Recall Pop-up Resources Entry Buffer ():...
Chapter 9: Configuring the Debugger Setting X Resources To set up demos or tutorials You can add demos or tutorials to the debugger’s graphical interface by modifying the resources described in the following tables. Demo Related Component Resources Resource Value Description *enableDemo False...
Page 305
Chapter 9: Configuring the Debugger Setting X Resources Tutorial Related Component Resources Resource Value Description *enableTutorial False Specifies whether True Help→Tutorial appears in the pull-down menu. *tutorialPopupSub.indexFile ./Xtutorial/Index-topics Specifies the file containing the list of topic and file pairs. *tutorialPopup.textColumns Specifies the width, in characters, of the of the tutorial topic list pop-up.
Page 306
Chapter 9: Configuring the Debugger Setting X Resources 2 Create the demo or tutorial index file. Each line in the index file contains first a quoted string that is the name of the topic which appears in the index pop-up and second the name of the file that is raised when the topic is selected.
Configuring the Emulator How to configure the emulator for your target system.
Page 308
Each target system differs in the way it uses the processor, memory, and memory mapped I/O devices. During system development, your needs for emulator resources may change as your target system design matures. You can allocate emulator resources using debugger commands. This resource allocation is called the emulator configuration.
Chapter 10: Configuring the Emulator To start the Emulator Configuration dialog box • Select Modify→Emulator Config... in either the debugger/emulator or emulator/analyzer graphical interface. The Emulator Configuration main menu and an Emultor Configuration window are displayed. The Emulator Configuration dialog box may be left running while you are using the debugger.
Chapter 10: Configuring the Emulator To modify a configuration section 1 Start the emulator Emulator Configuration dialog box. 2 Click on a section name in the Emulator Configuration main menu, and click the "Modify" pushbutton. 3 Use the command line in the Emulator Configuration window to answer the configuration questions.
Chapter 10: Configuring the Emulator To answer a configuration question, click the softkey pushbutton that has your answer. Or, click on the "Return" command pushbutton to accept the answer that is shown. When you answer a configuration question, you are normally presented with the next question in the section;...
Chapter 10: Configuring the Emulator To examine the emulator configuration 1 Select Modify→Emulator Config... to display the Emulator Configuration dialog box. 2 Click on the configuration section you wish to examine. 3 Click on the Return button or press < Return> on your keyboard to page through the configuration questions without changing their values.
Chapter 10: Configuring the Emulator To display the configuration context • When answering the configuration questions, choose Display→Context... from the pull-down menu. The current directory context and the current configuration files are displayed in a window. Click the Done pushbutton when you wish to close the window. To access configuration help information •...
Chapter 10: Configuring the Emulator To load a configuration file • Use the -C command line option when starting the debugger. • Use a default configuration file. • Select File→Load→Emulator Config. • Using the command line, enter Debugger Execution Environment Load_Config The emulation configuration file contains configuration information for the emulator.
Page 315
Note Default configuration files are also supplied with the HP 64907/B1478 68030/EC030 C compiler and HP 64903/B1461 68020 C compiler. You should copy the appropriate default configuration file for your memory configuration into your directory and name it default.EA. These files are located in...
Chapter 10: Configuring the Emulator To create or modify a configuration file • Use the Emulator Configuration dialog box to set up the configuration, then save the configuration using File→Store→Emul Config. • Change the configuration using the Debugger Execution Environment Modify_Config command from the command line.
Chapter 10: Configuring the Emulator Caution If you reload a configuration using the Debugger Execution Environment Load_Config command, the contents of memory will be changed. Even if the new configuration memory map is identical to the old memory map, you must reload the contents of memory. See also The Softkey Interface User’s Guide for your emulator 68020 C Cross Compiler Reference...
You can choose either a foreground or background monitor, and the base address where the monitor resides. (See the book Concepts of Emulation and Analysis that you received with your HP emulator for more information on foreground and background monitors.) If you’re using the MC68020 emulator with the background monitor, the...
Chapter 10: Configuring the Emulator Emulator Configuration Items foreground monitor to support your special target system needs. You can also specify the interrupt priority mask to use during foreground monitor execution. A foreground monitor must be used when the MMU of the 68030 is enabled. If the background monitor selected when you attempt to enable the MMU, the foreground monitor will be selected, by default.
Chapter 10: Configuring the Emulator Emulator Configuration Items reset vector addresses. In the emulation configuration questions, you will specify the appropriate values for the stack pointer and program counter so that they can be supplied by the emulator when they can’t be fetched from the reset vector addresses.
To restrict to real-time runs The emulator uses the emulation monitor program to implement some features, such as register displays. When the emulation processor executes the monitor, it is not executing your target system program. This may cause problems in target systems that need real-time program execution (uninterrupted execution of your target system program).
Chapter 10: Configuring the Emulator Emulator Configuration Items To enable the processor cache memory The MC68020 processor has a cache that stores the most recently used instructions. The MC68030/EC030 processor has an instruction cache like the MC68020, and additionally has a cache for recently used data. When enabled, processor caches increase processor performance.
Chapter 10: Configuring the Emulator Emulator Configuration Items specific memory range while obtaining maximum system performance in the remaining memory ranges. See “To assign memory map terms” later in this chapter. To enable one wait state for emulation memory In the MC68020 emulator, emulation memory doesn’t require any wait states for clock speeds under 25 MHz.
Chapter 10: Configuring the Emulator Emulator Configuration Items may not support external memory, but after a change in the application definition, more program code might be required, needing external memory. While the design is being changed, you can develop your program using emulation memory to simulate target system memory.
Chapter 10: Configuring the Emulator Emulator Configuration Items To select and configure the MC68030 emulation monitor If you are using the MC68020 or MC68EC030 emulator, skip to the next step. The emulation monitor is used to perform emulation functions, such as display and modification of emulation and target system memory.
Chapter 10: Configuring the Emulator Emulator Configuration Items background selects the background monitor. foreground selects the default foreground monitor that is built-in to the emulator. user_foreground allows you to load a custom emulation monitor. To set up specifications for the emulation monitor The background monitor overlays processor address space and doesn’t use any processor memory resources.
Page 327
Emulator Configuration Items More information on emulation monitors is given in the book Concepts of Emulation and Analysis that you received with your HP emulator. 1 Reset Map question. If you changed the monitor type, you need to answer the...
Page 328
Chapter 10: Configuring the Emulator Emulator Configuration Items 3 Read Specifier questions. If you answered yes to the periodic read question, answer the next two questions: Address for read cycles? Enter a hexadecimal address from 0 to 0ffffffffH. Function code for read cycles? Select a function code from the softkeys.
Page 329
Chapter 10: Configuring the Emulator Emulator Configuration Items this question, or to the interrupt level that was in effect before monitor entry, whichever is greater. This configuration item is ignored if you choose the background monitor. You can also block all target system interrupts. Example Suppose your target system has a disk device driver that uses interrupt level 5, and the service routine must be run to prevent target system damage.
Page 330
Chapter 10: Configuring the Emulator Emulator Configuration Items reads may cause unpredictable results to some I/O and target system memory addresses. You can relocate the background monitor (using this configuration item) so that these read cycles won’t occur in address space occupied by I/O or other target system hardware.
Page 331
Chapter 10: Configuring the Emulator Emulator Configuration Items interlocks emulator and target system cycle termination signals for monitor accesses. terminates monitor accesses with only the emulator-generated cycle termination signals. When you enable interlocking, emulation monitor cycles aren’t terminated until the target system DSACK (DSACK or STERM for the MC68030/EC030) is received.
Chapter 10: Configuring the Emulator Emulator Configuration Items To assign memory map terms The memory map should be on screen. You need to specify the location and type of various memory regions used by your programs and your target system. The emulator needs this information to: •...
Page 333
Chapter 10: Configuring the Emulator Emulator Configuration Items If you specify an address range less than 4K with the dp attribute, all 4K is allocated because that is the minimum block size for that memory. If you specify a block size less than 4K and the dual-port memory is unmapped, the emulator will use that memory to more closely match the requested address range to the block size.
Page 334
Chapter 10: Configuring the Emulator Emulator Configuration Items Installation Memory slot 0 Memory slot 1 Blocks Available 256K 256K 4-64K, 2-128K 256K 4-64K, 2-512K 256K 4-256K, 2-128K 4-256K, 2-512K 256K Empty 4-64K Empty 4-256K Empty 256K 2-128K Empty 2-512K Installation 2 is not recommended because it does not allocate blocks as well as installation 3. If you look down at the component side of the probe with the cables leading towards you, memory slot 0 is to your left and memory slot 1 is to your right.
Page 335
Chapter 10: Configuring the Emulator Emulator Configuration Items < fcode> Specifies a function code space for the memory as follows: < fcode> Description program Program space data Data space user User space supervisor Supervisor space user program User program space user data User data space supervisor program...
Page 336
Chapter 10: Configuring the Emulator Emulator Configuration Items accesses to this block. This attribute is available only on the MC68030/EC030 emulator. If you specify the dsi attribute, the emulator waits for both the emulation memory data to become valid and the target system DSACK to be returned before it terminates an emulation memory cycle.
Page 337
Chapter 10: Configuring the Emulator Emulator Configuration Items MC68020 (HP 64748) Attribute Description Emulation Target Memory Memory Use dual-port memory. Interlock DSACKs dp_dsi Use dual-port memory and interlock DSACKs 1. Only valid for the 4K dual-port memory. MC68030/EC030 (HP 64747)
Page 338
Chapter 10: Configuring the Emulator Emulator Configuration Items • Assign the memory map default by entering default < type> . where < type> may be one of: guarded target rom target ram The default map term tells the emulator how to treat all address ranges not otherwise covered by existing memory map terms.
Page 339
Chapter 10: Configuring the Emulator Emulator Configuration Items Example Suppose you’re using the emulator in-circuit, and there is a 12-byte I/O port at 1c000 hex in your target system. You have ROM in your target system from 0 through ffff hex. Also, you want to use the dual-port emulation memory at 20000 hex: 1c000h thru 1c0ffh target ram 0 thru 0ffffh target rom...
Chapter 10: Configuring the Emulator Emulator Configuration Items The emulator will allocate one 256K block from the SRAM memory modules and will use the 4-Kbyte, dual-port memory for the rest of the range. Only one mapper term is created (without the dp attribute). This combination of SRAM and dual-port memory affects the MC68020 emulator differently from the way it affects the MC68030/EC030 emulator.
Chapter 10: Configuring the Emulator Emulator Configuration Items To disable target system interrupts You may want to disable target system interrupts if your target system interrupt logic doesn’t work correctly or isn’t finished. You may also want to disable these interrupts if the service routines and vectors aren’t assigned. You may want to enable the interrupts if you’re ready to test your interrupt handling routines.
Page 342
Chapter 10: Configuring the Emulator Emulator Configuration Items There are cases where the interrupt stack pointer and program counter cannot be fetched from the reset vector table. For example, if you reset the emulator, break to the monitor, and then run the emulator, the stack pointer and program counter values will not be read from the normal locations.
Chapter 10: Configuring the Emulator Emulator Configuration Items To set the target memory access size When you display or modify target system memory or emulation memory that is not dual-port, the emulator makes the MC68020 or MC68030/EC030 processor execute the monitor to read or write target memory locations. The access mode determines whether the emulator uses byte, word, or long word instructions for the memory accesses.
Chapter 10: Configuring the Emulator Emulator Configuration Items To modify the debug/trace options You can define certain break conditions for the emulator and choose whether to trace only target program cycles or all program cycles. • Answer the question: Modify debug/trace options? to access the debug/trace configuration questions.
Chapter 10: Configuring the Emulator Emulator Configuration Items To define the software breakpoint vector The MC68020 and MC68030/EC030 emulators use the BKPT instruction to implement software breakpoints. The BKPT instruction has eight possible data operands. You can choose from seven of these for the software breakpoint function.
Chapter 10: Configuring the Emulator Emulator Configuration Items To trace background or foreground operation Normally, you’ll use the emulation-bus analyzer to trace only your target program execution. However, sometimes you may want to analyze execution of the emulation monitor to help solve a problem with the interaction of the target system and the emulator.
Chapter 10: Configuring the Emulator Emulator Configuration Items To configure the analyzer clock The emulation-bus analyzer can capture bus cycles at data rates up to 25 MHz. The trace state and time counters are limited to lower speeds. The MC68020 processor is set to a slow analyzer clock by default, and does not need to be modified because the data rate is sufficiently low, even at the maximum clock rate of 33 MHz.
Chapter 10: Configuring the Emulator Emulator Configuration Items The trace state and time count qualifiers are limited by the analyzer data rate settings as follows: Analyzer clock rate Analyzer speed Valid count qualifier setting options clock ≤ 16.67 MHz slow counting <...
Simulated I/O manual for details on configuring and using simulated I/O. To modify the interactive measurement specification The HP 64700 Series emulators have internal trigger signals that allow you to coordinate measurements with associated instruments. The interactive measurement specification defines these trigger connections.
Chapter 10: Configuring the Emulator Mapping The Foreground Monitor For Use With The MC68030 MMU Mapping The Foreground Monitor For Use With The MC68030 MMU To use the memory management feature of the MC68030 emulator, you have to use a foreground monitor that is mapped 1:1 (logical address = physical address).
Chapter 10: Configuring the Emulator Mapping The Foreground Monitor For Use With The MC68030 MMU To modify the MMU mappings to translate the monitor address space 1:1 1 In the operating system that sets up the MMU for your target program, set aside a 4 Kbyte address space to contain the foreground monitor.
Chapter 10: Configuring the Emulator Mapping The Foreground Monitor For Use With The MC68030 MMU To modify a transparent translation register to map the monitor address space 1:1 • Modify the value of a transparent translation register to the base address you specified for the foreground monitor, or the first address within the range to be occupied by the foreground monitor.
Chapter 11: X Resources and the Graphical Interface X Resources and the Graphical Interface This chapter helps you to understand how to set the X resources that control the appearance and operation of the debugger’s graphical interface. This chapter: • Gives you an explanation of the X Window concepts surrounding resource specification.
Chapter 11: X Resources and the Graphical Interface closely associated with the names of the widgets that make up the application. Each application begins with a top-level widget that is the parent of all other widgets in the application. The name of the top-level widget is usually the same as that of the application.
Chapter 11: X Resources and the Graphical Interface Instead of specifying the foreground color for the tracker quit button by using a resource name made up of instance names as in the last example, you could instead use a class name, as follows: tracker.panel.control.XmPushbutton.foreground: white Using class names in this way makes it easier to specify resources because it relieves you from having to discover the names of particular widgets in an...
Chapter 11: X Resources and the Graphical Interface tracker*XmPushButton.foreground: white may not only set the foreground color of the quit button on the control panel of the application to white — it could also set the foreground colors for any pushbutton anywhere in the application.
$HOME directory. The system directory for application default files is: HP-UX /usr/lib/X11/app-defaults SunOS /usr/openwin/lib/X11/app-defaults The name of the default file is the same as the class name for the application and is also called the app-defaults file (for example, HP64_Debug is the name of the debugger’s graphical interface’s application defaults file).
RESOURCE_MANAGER property. Some X servers have a resource property associated with the root window for the server. Resources are added to the resource property database by using xrdb. (HP VUE is an example.) The server can use this property to access those resources.
Chapter 11: X Resources and the Graphical Interface $XENVIRONMENT file. This environment variable defines a file that contains resource specifications. If the XENVIRONMENT variable is not set, then $HOME/.Xdefaults-host is read. Command line options Resources can be specified on the command line by using the -xrm command line option.
Page 363
/usr/hp64000/lib/X11/HP64_schemes. This directory is the upper level directory for scheme files. The other five files are in subdirectories below this one named by platform (or operating system). For example, the HP 9000 scheme files are in the subdirectory /usr/hp64000/lib/X11/HP64_schemes/HP-UX. Like the app-defaults file, these scheme files are system files and should not be...
Controls the platform scheme chosen by the interface. This resource is particularly useful in mixed-platform environments where you might be executing the interface remotely on an HP 9000 computer, but displaying the interface on a Sun SPARCsystem computer. In this situation, you may...
Page 365
/usr/hp64000/lib/X11/HP64_schemes (or alternative) and then set this resource to choose that subdirectory instead of the standard platform subdirectory. Values can be: HP-UX, SunOS, or the name of a sub-directory containing custom scheme files. HP64_Debug.colorScheme: Chooses the black and white or color scheme.
HP64_Debug file for information about that resource. If the RESOURCE_MANAGER property exists (as is the case with HP VUE), copy the complete HP64_Debug file, or just the part you are interested in, to a temporary file. Modify the resource in your temporary file and save the file.
Page 367
Chapter 11: X Resources and the Graphical Interface scheme files can be found in the previous “Scheme files augment other resources” section. Copy the appropriate scheme file to one of the alternative directories and make the modifications there. (If you are using $XAPPLRESDIR, make sure the variable is set and exported.) Save the file.
Page 368
Chapter 11: X Resources and the Graphical Interface...
Chapter 12: Debugger Commands How Pulldown Menus Map to the Command Line Pulldown Command Line File→Context→Directory Debugger Directory Change_Working Program Context Set File→Context→Symbols Debugger Execution Environment Load_Config File→Load→Emulator Config File→Load→Executable Program Load Default File→Load→Program Only Program Load New Code_Only No_Pc_Set File→Load→Symbols Only Program Load New Symbols_Only No_Pc_Set File→Load→User-Defined Macros...
Page 373
Chapter 12: Debugger Commands Pulldown Command Line Display→Context Display→Memory→Mnemonic () Memory Display Mnemonic Display→Memory→byte Memory Display Byte Memory Display Word Display→Memory→word Display→Memory→long Memory Display Long Display→Source () Program Display_Source Program Context Set Display→Source at PC Display→Source Find Fwd () Program Find_Source Occurrence Forward Display→Source Find Back () Program Find_Source Occurrence Backward Program Find_Source Next...
Chapter 12: Debugger Commands How Popup Menus Map to the Command Line Code window pop-pup Command Line Set/Delete Breakpoint Breakpt Instr or Breakpt Delete Attach Macro Edit Attached Macro Edit source Run until Program Run Until # < line_number> Trace After Trace Trigger Address Is # <...
Page 376
Chapter 12: Debugger Commands Backtrace window pop-up Command Line Disp Source at Stack Level Program Context Set @< level> Disp Vars at Stack Level Program Context Expand @< level> Run Until Stack Level Program Run Until @< level> Status Line Popup Command Line Command Line On/Off Remove Temporary Message...
Chapter 12: Debugger Commands Expression Commands Expression commands calculate expression values, print formatted output to a window, and monitor variables. Command Definition Expression C_Expression Calculate the value of a C expression Expression Display_Value Display the value of an expression or variable Expression Fprintf Print formatted output to a window Expression Monitor Clear_All...
Chapter 12: Debugger Commands Memory Commands Memory commands do operations on the target microprocessor’s memory. Command Definition Memory Assign Change the values of memory locations Memory Block_Operation Copy Copy a memory block Memory Block_Operation Fill Fill a memory block with values Memory Block_Operation Match Compare two blocks of memory Memory Block_Operation Search...
Chapter 12: Debugger Commands Program Commands Program commands load and execute programs, control program execution, display source code and program variables, and set or cancel program interrupts. Command Definition Program Context Set Specify current module and function scope Program Context Display Display all local variables of a function Program Context Expand Display all local variables of a function at...
Chapter 12: Debugger Commands Trace Commands Trace commands let you do bus level tracing of your program activity with bus cycle store qualification of data. Command Definition Trace Again Start a trace using the last defined trigger and qualification terms Trace Display Display trace information in the View window Trace Event Clear_All...
Chapter 12: Debugger Commands Breakpt Access Breakpt Access The Breakpt Access command sets an access breakpoint at the specified memory location (< addr> ) or range (< addr> ..< addr> ). The access breakpoint halts program execution each time the target program attempts to read from or write to the specified memory location or range.
Chapter 12: Debugger Commands Breakpt Access Interaction with trace commands The Breakpt Access command and Trace Trigger command both require use of emulation analyzer resources. If access breakpoints are active (indicated by the message TRC: BrkRWA on the status line), then a Trace Trigger command may not be entered.
Page 384
Chapter 12: Debugger Commands Breakpt Clear_All Breakpt Clear_All The Breakpt Clear_All command clears (removes) all defined breakpoints. See Also Breakpt Access Breakpt Write Breakpt Delete Program Run Breakpt Instr Program Step Breakpt Read Examples To remove all defined breakpoints: Breakpt Clear_all...
Chapter 12: Debugger Commands Breakpt Delete Breakpt Delete The Breakpt Delete command deletes (removes) one or more previously set breakpoints. When you set a breakpoint, the debugger assigns it a breakpoint number. Use this breakpoint number (< brkpt_nmbr> ) to remove a specific breakpoint.
Chapter 12: Debugger Commands Breakpt Instr Breakpt Instr The Breakpt Instr command sets an instruction breakpoint at a specified memory location (< addr> ) or range (< addr> ..< addr> ). The instruction breakpoint halts program execution each time the target program attempts to execute an instruction at the specified memory location(s).
Page 387
Chapter 12: Debugger Commands Breakpt Instr – If the macro return value is true (nonzero), the debugger resumes execution starting at the instruction where the break occurred. No breakpoint information is displayed. – If the macro return value is false (zero), the debugger returns to command mode without executing the instruction where the break occurred and displays breakpoint information.
Chapter 12: Debugger Commands Breakpt Read Breakpt Read The Breakpt Read command sets a read breakpoint. The read breakpoint halts program execution each time the target program attempts to read data from the specified memory location (< addr> ) or range (< addr> ..< addr> ). The Breakpt Read command behaves just like the Breakpt Access command.
Chapter 12: Debugger Commands Breakpt Write Breakpt Write The Breakpt Write command sets a write breakpoint. The write breakpoint halts program execution each time the target memory attempts to write data to the specified memory location (< addr> ) or range (< addr> ..< addr> ). The Breakpt Read command behaves just like the Breakpt Access command.
Chapter 12: Debugger Commands Debugger Directory Debugger Directory The Debugger Directory command displays or changes the current working directory. When you specify the Show_Working parameter, the debugger displays the current working directory in the journal window. When you specify the Change_Working parameter with a directory name, the debugger makes that directory the current working directory.
Chapter 12: Debugger Commands Debugger Execution Display_Status Debugger Execution Display_Status The Debugger Execution Display_Status command activates the debugger View window and displays the following status information: Version of debugger Current working directory Current log file Current journal file Startup file used in current debug session Loaded absolute files If no files have been loaded, the absolute file will be missing from the display.
Chapter 12: Debugger Commands Debugger Execution Environment FwdCmd Debugger Execution Environment FwdCmd The Debugger Execution Environment FwdCmd command enables you to forward commands to other interfaces which are using the same emulator. The other interfaces are: Emul Emulator/analyzer interface. If several emulator interfaces are sharing the emulator, the command will be forwarded to the most recently started interface.
Chapter 12: Debugger Commands Debugger Execution Environment Load_Config Debugger Execution Environment Load_Config The Debugger Execution Environment Load_Config command loads an emulation configuration file for the emulator. The emulation configuration file contains configuration information for the emulator. The debugger/emulator accepts files generated by the emulation software or by an editor.
Chapter 12: Debugger Commands Debugger Execution Environment Modify_Config Debugger Execution Environment Modify_Config The Debugger Execution Environment Modify_Config command starts a process which allows you to modify the current emulator configuration. See Also The “Configuring the Emulator” chapter in this manual.
Chapter 12: Debugger Commands Debugger Execution IO_System Debugger Execution IO_System The Debugger Execution IO_System command enables you to configure the simulated I/O system to use the host system keyboard, display, and file system to simulate I/O devices for your target program. Debugger Execution IO_System Enable The Debugger Execution IO_System Enable command enables the debugger simulated I/O system.
Page 396
Chapter 12: Debugger Commands Debugger Execution IO_System host computer file system. Two special filenames allow you to access the system keyboard (/dev/simio/keyboard) and the system display (/dev/simio/display). Debugger Execution IO_System Mode The Debugger Execution IO_System Mode command selects how keyboard I/O input is processed.
Page 397
Chapter 12: Debugger Commands Debugger Execution IO_System Examples To enable simulated I/O: Debugger Execution IO_System Enable To disable simulated I/O: Debugger Execution IO_System Disable To redirect the standard input file to the keyboard, the standard output file to the display, and the standard error file to file ’/users/project/errorfile’: Debugger Execution IO_System Stdio_Redirect "/dev/simio/keyboard","/dev/simio/display", "/users/project/errorfile"...
Chapter 12: Debugger Commands Debugger Execution Load_State Debugger Execution Load_State The Debugger Execution Load_State command restores the memory contents and register values saved with the debugger/simulator Debugger Execution Save_State command. If you do not specify a file name (< save_file> ), the debugger uses the default file db68k.sav for the 68020 and the file db68040.sav for the 68030.
Chapter 12: Debugger Commands Debugger Execution Reset_Processor Debugger Execution Reset_Processor The Debugger Execution Reset_Processor command resets the microprocessor to its initial state. It performs the following operations: The program counter is loaded from exception vector 1 at location 4. The interrupt stack pointer is loaded from exception vector 0 at location 0 in memory.
Chapter 12: Debugger Commands Debugger Host_Shell Debugger Host_Shell The Debugger Host_Shell command enables you to temporarily leave the debugging environment by forking an operating system shell or to execute a single UNIX operating system command from within the debugger. The type of shell forked is based on the shell variable SHELL.
Page 401
Chapter 12: Debugger Commands Debugger Host_Shell Wait Suspends the interface until the command completes. NoPrompt When the command completes, the "cmdscript" window is closed immediatelly. See Also Debugger Quit Examples To temporarily exit the debugger to the UNIX operating system command mode: Debugger Host_Shell To write the current working directory to the journal window:...
Chapter 12: Debugger Commands Debugger Help Debugger Help This command displays the on-line help screen. The debugger provides on-line help for all debugger commands, debugger command arguments, and debugger function keys. You can access on-line help by entering the command Debugger ? or by pressing the F5 function key.
Chapter 12: Debugger Commands Debugger Level Debugger Level The Debugger Level command selects either high-level mode or assembly-level mode for debugging. When debugging programs containing C modules, you can switch back and forth between the two modes. If the program contains no high-level modules accessible to the debugger, the debugger displays an error message if you attempt to select high-level mode.
Chapter 12: Debugger Commands Debugger Macro Add Debugger Macro Add The Debugger Macro Add command defines a macro. The name of the macro is specified by <macro_name> . The result type of the macro is specified by <type> . If a type is not specified, it defaults to type int. A parenthesized list of parameters (<param_list>) may optionally follow the macro name.
Page 405
Chapter 12: Debugger Commands Debugger Macro Add The curly braces ( { } ) are required punctuation. Formal arguments can be used throughout the macro definition, and are later replaced by the actual arguments in the macro call. The maximum number of characters that can be entered on a line in a macro definition is 255.
Page 406
Chapter 12: Debugger Commands Debugger Macro Add Debugger Macro Call Debugger Macro Display Program Run Symbol Remove The “Using Macros and Command Files” chapter The “Predefined Macros” chapter in this manual. Example Debugger Macro Add int power(x, y) /* Loop counter */ int multiplier;...
Chapter 12: Debugger Commands Debugger Macro Call Debugger Macro Call The Debugger Macro Call command calls a macro previously defined by the Debugger Macro Add command or a macro built into the debugger. See Also Debugger Macro Add Debugger Macro Display Symbol Remove Example To call the previously defined macro ’stackchk()’:...
Chapter 12: Debugger Commands Debugger Macro Display Debugger Macro Display The Debugger Macro Display command displays the source code for the named macro. If a window number is specified (< user_window_nmbr> ), the macro source is written to the file or user-defined window associated with the number.
Chapter 12: Debugger Commands Debugger Option Command_Echo Debugger Option Command_Echo The Debugger Option Command_Echo command controls whether or not commands executed from a command file are echoed (copied) to the Journal window. If the oFF parameter is specified, only the results (if any) of a command are copied to the Journal window.
Chapter 12: Debugger Commands Debugger Option General Debugger Option General The Debugger Option General command changes the default values for the following debugger startup options for the current debugging session: Align_Bp Aligns breakpoints with processor instruction start Frame_Stop Controls stack walking Demand_Load Enables/disables demand loading of symbols Radix...
Page 411
Chapter 12: Debugger Commands Debugger Option General command to save the new default values in a startup file. See the File Startup command for more information. Align_Bp The Align_Bp option controls automatic alignment of low-level breakpoints and automatic alignment of disassembly. If the Align_Bp option is set to On , the debugger locates what it interprets as the starting address of all instructions in a module (by disassembling code from the beginning of the module).
Page 412
Chapter 12: Debugger Commands Debugger Option General otherwise load because of very large amounts of symbol information. The default setting for Demand_Load is oFF . There are several side effects of demand loading. The debugger command Memory Unload_BBA is disabled. Type mismatch errors may not be detected during the initial load of the executable (.x) file.
Chapter 12: Debugger Commands Debugger Option List Debugger Option List The Debugger Option List command lists the current debugger option values in the Journal window. The list will be similar to the sample list shown in the example. See Also Debugger Option Command_Echo Debugger Option General Debugger Option Symbolics...
Chapter 12: Debugger Commands Debugger Option Symbolics Debugger Option Symbolics The Debugger Option Symbolics command changes the default values for the following debugger symbol options and C source line display options for the current debugging session: Assem_Symbols Displays symbols in assembly code Intermixed Intermixes C source with assembly code Check_Args...
Page 415
Chapter 12: Debugger Commands Debugger Option Symbolics Intermixed The Intermixed option intermixes C source code with the assembly code generated for each respective C statement. This option is off by default. Check_Args The Check_Args option controls parameter checking in commands and macros.
Chapter 12: Debugger Commands Debugger Option Trace Debugger Option Trace The Debugger Option Trace command changes the default behavior of bus-level tracing. Count If Count is Nothing , all of the trace memory will be used to store bus states. If Count is Time , half of the trace memory will be used to store timing information.
Chapter 12: Debugger Commands Debugger Option View Debugger Option View The Debugger Option View command changes the default values for the following debugger display options for the current debugging session: Breakpt_Window View_Window Highlight More Stdio_Window Amt_Scroll Use the Debugger Option List command to display the current option values. To permanently change any of the default values, first use the appropriate Debugger Option command to change the value(s) and then use the File Startup command to save the new default values in a startup file.
Page 418
Chapter 12: Debugger Commands Debugger Option View Breakpt_Window The Breakpt_Window option controls the display of the breakpoint window. The On setting causes the Breakpoint window to be displayed at all times. The window may be hidden by other windows but will be displayed whenever a breakpoint is set or deleted.
Page 419
Chapter 12: Debugger Commands Debugger Option View Stdio_Window The Stdio_Window option controls the display of the Stdio window. The Swap setting causes the Stdio window to be displayed when a program writes to it and to be removed when the program returns to the command mode.
Chapter 12: Debugger Commands Debugger Pause Debugger Pause The Debugger Pause Time command pauses the debugger for the specified number of seconds or (if you enter the Debugger Pause command without the Time parameter) pauses the debugger until you press the space bar, CTRL C, or the escape key (Esc) twice.The Debugger Pause command is useful when executing command files.
Chapter 12: Debugger Commands Debugger Quit Debugger Quit The Debugger Quit command ends a debugging session without saving the session. If you enter the command Debugger Quit Yes , the debugging session is immediately ended. The Debugger Quit command does not save the debugging session. Use the File Startup command to save the current set of debugger startup options and window parameters in a startup file.
Page 422
Chapter 12: Debugger Commands Debugger Quit Examples To terminate the debugging session immediately: Debugger Quit Yes To terminate the debugging session and release the emulator hardware so that other users can access it: Debugger Quit Released To terminate the debugging session and lock the emulator hardware so that other users cannot access it: Debugger Quit Locked...
Chapter 12: Debugger Commands Expression C_Expression Expression C_Expression The Expression C_Expression command calculates the value of most valid C expressions or assigns a value to a variable. The result is displayed in floating point or in decimal, hexadecimal, and ASCII formats. The Expression C_Expression command can be used to set C variables by specifying a C assignment statement.
Chapter 12: Debugger Commands Expression Display_Value Expression Display_Value The Expression Display_Value command displays expressions and their values in the Journal window. All expressions displayed with this command are displayed according to their type as shown in the following list: Type Display Format Ints 32-bit signed decimal numbers...
Page 425
Chapter 12: Debugger Commands Expression Display_Value If an expression range is displayed, each value within the range is displayed according to the base type (if one exists). For example, if the variable flags is a character array, the following command results in elements flags[10] through flags[30] being displayed: Expression Display_Value flags+10..+30 Note that the command first evaluates flags[10] to a character, and uses...
Page 426
Chapter 12: Debugger Commands Expression Display_Value Expression Display_Value time To display the values of the members of structure ’time’: hours minutes 0 seconds 20 Expression Display_Value *time To display the name of the current program module: Expression Display_Value @module To display the name of the current program function: Expression Display_Value @function...
Chapter 12: Debugger Commands Expression Fprintf Expression Fprintf The Expression Fprintf command prints formatted output to the specified user-defined window. Formatted output may be written to a file that has been opened by the File User_Fopen command. The Expression Fprintf command is similar to the C fprintf function.
Page 428
Chapter 12: Debugger Commands Expression Fprintf – indicates that the result of conversion is to be left-justified within the field. digits is a string of one or more decimal characters. The first digits is a minimum field width. The field will be at least this many characters wide, padded if necessary.
Page 429
Chapter 12: Debugger Commands Expression Fprintf The double argument is converted to decimal notation in the format [–]ddd.ddd, where the number of digits after the decimal point is equal to the precision specification. If the precision is not specified, it is 6 by default; if the precision is explicitly zero, no decimal point appears.
Page 430
Chapter 12: Debugger Commands Expression Fprintf The argument is converted to hexadecimal. Letters are displayed in lower case. The character % is substituted for the field. Any other non-conversion character following a % is printed. %% is used to generate % in the output as a literal character. Conversion characters are case-sensitive.
Page 431
Chapter 12: Debugger Commands Expression Fprintf See Also Expression Printf File Journal File Log File User_Fopen Window New Examples To print value of ’var’ to user window 57 as a single character: Expression Fprintf 57,"%c",var To print the string in double quotes to user window 57 followed by the floating point value of ’temperature’...
Chapter 12: Debugger Commands Expression Monitor Clear_All Expression Monitor Clear_All The Expression Monitor Clear_All command stops monitoring of all expressions being monitored with the Expression Monitor Value command and removes all expressions from the Monitor window. See Also Expression Fprintf Expression Monitor Delete Expression Monitor Value Expression Printf...
Chapter 12: Debugger Commands Expression Monitor Delete Expression Monitor Delete The Expression Monitor Delete command stops monitoring of specified expressions being monitored with the Expression Monitor Value command and removes those expressions from the Monitor window. When an expression is monitored using the Expression Monitor Value command, it is assigned a line number, which is displayed in the Monitor window.
Chapter 12: Debugger Commands Expression Monitor Value Expression Monitor Value The Expression Monitor Value command monitors the specified expressions as the target program is executing. Expressions are updated and displayed in the Monitor window each time the debugger stops executing the program. Up to seventeen lines, selected by the display line range parameter (;<...
Page 435
Chapter 12: Debugger Commands Expression Monitor Value Ints 32-bit signed decimal numbers Longs 32-bit signed decimal numbers Shorts 16-bit signed decimal numbers Chars 8 bit characters (unsigned hexadecimal numbers if not printable) Pointers 32-bit unsigned numbers Enums Name of Enumerator constant (enumerator value if name not defined) Arrays All elements if enough lines, else first element...
Page 436
Chapter 12: Debugger Commands Expression Monitor Value the expression is displayed on that line. If you specify a range of lines, the amount of data that will fit on those lines is displayed. See Also Expression Monitor Clear_All Expression Monitor Delete Symbol Display Examples To monitor the value of variable ’current_temp’:...
Chapter 12: Debugger Commands Expression Printf Expression Printf The Expression Printf command prints formatted output to the Journal window. See the Expression Fprintf command for a detailed description. See Also Expression Fprintf File User_Fopen Examples To print the string in double quotes to the journal window followed by the floating point value of ’temperature’...
Page 438
Chapter 12: Debugger Commands Expression Printf Expression Printf "%m", 2030h 00002030 2040 MOVEA.L D0,A0 To print the contents of the assembly-level stack window to the Journal window: Expression Printf "%w",14 > Expression Printf "%w",14 00043FC8=00000690 FP->00043FC4=00043FF0 00043FC0=000604AC 00043FBC=00000001 SP->00043FB8=00000001...
Chapter 12: Debugger Commands File Command File Command The File Command command reads the file specified by < file_name> and executes the commands contained in the file as though they were entered from the keyboard. Commands in the file are executed until the end of the file is reached.
Page 440
Chapter 12: Debugger Commands File Error_Command File Error_Command The File Error_Command command sets the command file error handling mode. The command specifies what action the debugger takes when an error occurs while reading a command file. Abort_Read causes the debugger to return to the command line after an error and wait for keyboard input.
Chapter 12: Debugger Commands File Journal File Journal The File Journal command copies the information written to the Journal window output into a journal file specified by < file_name> . The default journal filename extension .jou will be appended to < filename> . The journal file provides a history of your debugging session.
Chapter 12: Debugger Commands File Log File Log The File Log command records user input in a command file, specified by < file_name> . The default filename extension .com will be appended to < filename> . The File Log command allows an interactive debugger session to be logged as a command file which can be rerun at a later time.
Page 443
Chapter 12: Debugger Commands File Log Examples To make and open log file ’log1.com’ for writing: File Log On log1 To close the currently open log file: File Log oFF To open existing log file ’log1.com’ for writing and append new information at the end of the file: File Log Append log1 To place the comment ’This is a comment string’...
Chapter 12: Debugger Commands File Startup File Startup The File Startup command saves the current debugger startup options and window parameters in a startup file specified by < startup_file> . When you start a debugging session and specify the startup file with the -s option of the db68k command, the startup options and window parameters you saved will be the default parameters in that debugging session.
Page 445
Chapter 12: Debugger Commands File Startup Option Command Default Setting Parameters Align_Bp Amt_Scroll Assem_Symbols Breakpt_window Swap Check_Args Command_Echo Demand_Load Exceptions Stop Frame_Stop Highlight Inverse Intermixed More Processor 68020 or 68030/EC030 Radix Decimal_Input, Decimal_Output Stdio_Window Swap Step_Speed View_Window Swap Window Information Window sizes, user windows, and window locations You can specify a command file to be executed when the debugger starts.
Page 446
Chapter 12: Debugger Commands File Startup To save the current set of debugger startup options and window parameters in startup file ’my_start_file.rc’ and execute the command file ’initDemo.com’ whenever the debugger is started using ’my_start_file.rc’: File Startup my_start_file , initDemo...
Chapter 12: Debugger Commands File User_Fopen File User_Fopen The File User_Fopen command opens the file specified by < file_name> for reading or writing and assigns a window number to it. The File User_Fopen Append command opens an existing file for writing, adding new information at the end of the file.
Page 448
Chapter 12: Debugger Commands File User_Fopen Examples To open user window 57 and redirect any data written to window 57 to the file ’varTrace.out’: File User_Fopen Create 57 File varTrace.out To open user window 57 and append any data written to window 57 to the existing file ’varTrace.out’: File User_Fopen Append 57 File varTrace.out To open file ’temp.dat’...
Page 449
Chapter 12: Debugger Commands File Window_Close File Window_Close The File Window_Close command closes a device or file which was previously opened with the File User_Fopen command. The Window Delete command may also be used for this purpose. See Also File User_Fopen Window Delete Example To close file associated with user window number 57:...
Chapter 12: Debugger Commands Memory Assign Memory Assign Note Debugger/emulators cannot modify memory locations in target ROM The Memory Assign command changes the contents of the memory location specified by < addr> to the value or values defined by the expression < expr> or expression string <...
Page 451
Chapter 12: Debugger Commands Memory Assign assume that the variable count is a long integer. If you want to set the value of count equal to 5, the command Memory Assign Long count=5 will not work. The command will set the memory location referenced by the value of count equal to 5, not the contents of the variable.
Chapter 12: Debugger CommandsMemory Block_Operation Copy Memory Block_Operation Copy Note Debugger/emulators cannot copy to memory locations in target ROM. The Memory Block_Operation Copy command copies the contents of the memory range specified by < addr> ..< addr> to a block of the same size starting at the memory location specified by <...
Chapter 12: Debugger Commands Memory Block_Operation Fill Memory Block_Operation Fill Note Debugger/emulators cannot fill memory locations in target ROM. The Memory Block_Operation Fill command fills the range of memory locations specified by the address range < addr> ..< addr> with the value or values specified by an expression <...
Page 454
Chapter 12: Debugger Commands Memory Block_Operation Fill in memory until all designated memory locations are filled. If you specify more values than can be contained in the specified address range, the debugger ignores the excess values. See Also Memory Assign Memory Block_Operation Copy Memory Block_Operation Match Memory Block_Operation Search...
Chapter 12: Debugger Commands Memory Block_Operation Match Memory Block_Operation Match The Memory Block_Operation Match command compares the contents of two blocks of memory to determine their similarities or differences. The command compares the block of memory specified by the address range <...
Page 456
Chapter 12: Debugger Commands Memory Block_Operation Match Examples To compare the block of memory starting at address 1000h and ending at address 10ffh with a block of the same size beginning at address 5000h and stop when a difference is found: Memory Block_Operation Match Stop_On_Mismatch 1000h..10ffh,5000h To execute the previous Memory Block_Operation Match...
Chapter 12: Debugger Commands Memory Block_Operation Search Memory Block_Operation Search The Memory Block_Operation Search command searches the block of memory specified by < addr> ..< addr> for the specified expression < expr> or expression string< expr_string> . The size qualifier (Byte, Word, or Long) specifies the size of an expression or each expression in an expression string.
Page 458
Chapter 12: Debugger Commands Memory Block_Operation Search See Also Memory Display Memory Block_Operation Copy Memory Block_Operation Fill Memory Block_Operation Match Memory Block_Operation Test Program Find First Program Find Next Examples To search for the expression ’gh’ in the memory range from address 1000h through address 10ffh and stop when the expression is found or address 10ffh is reached: Memory Block_Operation Search Word Once...
Chapter 12: Debugger Commands Memory Block_Operation Test Memory Block_Operation Test The Memory Block_Operation Test command examines the specified memory locations specified by < addr..addr> to verify that the value(s) defined by < expr> or < expr_string> exist throughout the specified memory area. When the debugger finds a mismatch, it displays the mismatched address and value.
Page 460
Chapter 12: Debugger Commands Memory Block_Operation Test the test of a previous Memory Block_Operation test command given with the Once qualifier, beginning with the last address tested. Repeatedly Qualifier If you specify the Repeatedly qualifier, the debugger continues testing the specified value(s) for mismatches until the end of the block is reached, or until you enter CTRL C.
Chapter 12: Debugger Commands Memory Display Memory Display The Memory Display displays the contents of the specified memory locations. Mnemonic Option The Mnemonic option displays memory in assembly language mnemonics starting at the memory location specified by < addr> . If you do not specify an address, the debugger displays memory beginning with the address pointed to by the program counter.
Page 462
Chapter 12: Debugger Commands Memory Display Note If the Align_bp option is set to On, the address of the first instruction in the assembly Code window may be incorrect after executing the Memory Display Mnemonic command. Byte, Word, and Long Options The byte, word, or long qualifier option displays the contents of memory locations specified by <...
Chapter 12: Debugger Commands Memory Register Memory Register The Memory Register command changes the contents of a register, status flag, or other processor variables such as pc or sp. The new contents are defined by < value> . The PC (program counter) is displayed or changed if you do not specify a register name.
Page 464
Chapter 12: Debugger Commands Memory Register The program counter (PC) is displayed in the Journal window. You can modify the PC by entering a value (10a4h in this example) at the cursor prompt and pressing Return. The PC will be modified, and the next register will be displayed: = 0x000010B8 4280: 10a4h...
You must have the HP Branch Validator product for the processor you are debugging code for installed on your system in order to use this command. If you do not have the HP Branch Validator for your processor, the debugger will display the following error message when you attempt to execute this...
Page 466
Chapter 12: Debugger Commands Memory Unload_BBA Note The Unload_BBA command is disabled when the debugger option Demand_Load is On. If Demand_Load is oFF but the program was loaded with Demand_Load On, the Memory Unload_BBA command will generate a BBA file with incomplete information. See the Debugger Option General command description in this manual for more information on the Demand_Load option.
Page 467
Chapter 12: Debugger Commands Memory Unload_BBA To unload all branch analysis information into file "mydata": Memory Unload_BBA All To "mydata" To unload branch analysis information associated with absolute file a.out.x into file "bbadump.data": Memory Unload_BBA Load_file "a.out" To unload branch analysis information associated with absolute file a.out.x into file "mydata": Memory Unload_BBA Load_file "a.out"...
Chapter 12: Debugger Commands Program Context Display Program Context Display The Program Context Display command displays the current module, function, and line number in the Journal window. The current module is the one pointed to by the program counter. This command will display both the view context, as set by a Program Context Set command, and the context of the current program counter, if the two are different.
Chapter 12: Debugger Commands Program Context Expand Program Context Expand The Program Context Expand command displays values of the parameters passed to a function, and the local variables in a function. The values are displayed in the Journal window. To display a function’s calling parameters and local variables, specify the function’s stack level preceded by an at sign (@).
Chapter 12: Debugger Commands Program Context Set Program Context Set The Program Context Set command changes the default module and function (context). The current module (the one to which the program counter is pointing) is the default when functions are referenced without a module or function qualifier.
Chapter 12: Debugger Commands Program Display_Source Program Display_Source The Program Display_Source command displays C source code in the Code window beginning at the specified line or function. This command works in high-level mode only. If you do not specify a line number or function name, the debugger displays the line pointed to by the program counter.
Chapter 12: Debugger Commands Program Find_Source Next Program Find_Source Next The Program Find_Source Next command searches a high-level source program for the next occurrence of the string specified in the last Program Find_Source Occurrence command. When the debugger finds the string, it displays the line containing the string at the top of the Code window.
Chapter 12: Debugger Commands Program Find_Source Occurrence Program Find_Source Occurrence The Program Find_Source Occurrence command searches a high-level source file for the first occurrence of the specified string. If you provide a line number, the debugger searches for the string starting at the given line number. If you do not specify a line number, the string search starts at the top of the Code window.
Page 474
Chapter 12: Debugger Commands Program Find_Source Occurrence Examples To search forward through the current module for the string ’time’: Program Find_Source Occurrence Forward ’time’ To search backward through the current module for the string ’time’, starting at line 237: Program Find_Source Occurrence Backward ’time’,#237 To search forward through the module ’main’, for the string system_is_running, beginning at line 1: Program Find_Source Occurrence Forward...
Chapter 12: Debugger Commands Program Load Program Load The Program Load command loads the specified executable module into the debugger. Default Parameter When you specify the Default parameter, the debugger: • removes all previous program symbols • removes all previously set breakpoints •...
Page 476
Chapter 12: Debugger Commands Program Load program image, the program symbols, or both. The program counter can be set from the transfer address in the load file or ignored. The Append parameter loads another program without deleting the existing program. If you enter the Program Load command with the New or Append parameter, the following qualifiers are available: Both the program image and program symbols to be...
Chapter 12: Debugger Commands Program Load See Also Debugger Execution Reset_Processor Program Pc_Reset Debugger Option General Demand_Load Examples To load absolute file ’ecs’, remove all existing program symbols, reset the program counter, and load the full symbol set: Program Load Default ecs To load only the program image of the prog section of absolute file ’ecs’...
Page 478
Chapter 12: Debugger Commands Program Pc_Reset Program Pc_Reset The Program Pc_Reset command resets the program counter to the transfer address from the absolute file. This causes the next Program Run or Program Step command to restart execution at the beginning of the program. The command does not clear breakpoints.
Chapter 12: Debugger Commands Program Run Program Run The Program Run command starts or continues target program execution. The program runs until it encounters a permanent or temporary breakpoint, an error, or a stop instruction, or until you press CTRL C. The Program Run command may be used to resume execution after program execution has been suspended.
Page 480
Chapter 12: Debugger Commands Program Run Program Run fromReset Resets processor and then starts execution as the processor does when reset. Program Run Until The Program Run Until command begins program execution at the current program counter address and breaks at the specified address. Break Address The break address (<...
Page 481
Chapter 12: Debugger Commands Program Run Breakpt Instr Breakpt Read Breakpt Write Program Pc_Set Program Step Examples To execute the target program starting at address ’main’: Program Run From main To begin program execution at the current program counter address and run until line 110 of the current module: Program Run Until #110 To begin program execution at the current program counter address, run until...
C source line or one machine instruction. Note If the debugger steps into an HP library routine, you can then use the Program Run Until @1 (stack level 1) command to run to the end of the library routine.
Page 483
Chapter 12: Debugger Commands Program Step Program Step Count The Program Step Count command executes the specified number of either instructions or lines, starting at the location pointed to by the program counter. The debugger updates the screen after each instruction or line is executed. If a breakpoint is encountered, single-stepping is halted.
Chapter 12: Debugger Commands Program Step Over Program Step Over The Program Step Over command executes the number of instructions or lines specified, but executes through function calls, that is, the called function is executed without stepping through it. Execution begins at the specified starting address.
Chapter 12: Debugger Commands Program Step Over Program Step Over Count The Program Step Over Count command executes the specified number of either instructions or lines, starting at the location pointed to by the program counter. The debugger updates the screen after each instruction or line is executed.
Page 486
Chapter 12: Debugger Commands Program Step With_Macro Program Step With_Macro The Program Step With_Macro command single steps through the program and executes the specified macro (< macro_call> ) after each instruction or high-level line. Program execution continues if the macro returns a nonzero value.
Chapter 12: Symbol Add Symbol Add The Symbol Add command creates a symbol and adds it to the debugger symbol table. When defining a symbol, you must declare the symbol’s name. It may be any name not previously used. Type You can optionally assign any valid C data type <...
Page 488
Chapter 12: Symbol Add Program Symbols Program symbols are specified with a base address (Address < target_memory_address> ). The base address references an address in target memory. Program symbols are identical to variables defined in a C or assembly language program. The value of a program symbol is placed in target memory. If an initial value is specified for the program symbol, the value is loaded in the memory location referenced by the symbol.
Page 489
Chapter 12: Symbol Add In this example, we assigned a value to the symbol that is too large for the specified type. In this case, the debugger fills the memory location with the lower bytes of the specified value. Executing the command: Expression Printf "%x",s1 shows that the value is 203, the lower two bytes of the specified value.
Chapter 12: Symbol Browse Symbol Browse The Symbol Browse command displays the parents and children of a C+ + class. The inheritance relationship is displayed in the Journal window. Example To display the parents and children of the C+ + class fruit, type: Symbol Browse fruit...
Chapter 12: Symbol Display Symbol Display The Symbol Display command displays symbols and associated information in the Journal window.
Page 492
Chapter 12: Symbol Display To display symbols in all modules, specify a backslash as the command argument. Symbol Display Default \ To displays all symbols in a specified module or function, enter a module name or function name followed by a backslash. Symbol Display Default memset\ The wildcard character * may be placed at the end of a symbol name with any option.
Page 493
Chapter 12: Symbol Display Search_All displays symbols of all types in all roots (contexts). Wide shows symbol names only in multicolumn (compressed) format. If you do not specify any options, the debugger displays all symbols. Warnings When you execute the Symbol Display Warnings command, the debugger displays type mismatches.
Page 494
Chapter 12: Symbol Display update_state_of\refresh : Type is Local int. Address = Frame + 8 update_state_of\interval_complete : Type is Local int. Address = Frame + 12 To display all modules in the current symbol tree: Symbol Display Options Modules End_Options \ Symbol Display Options Modules End_Options \ Root is: @ecs 31 source and 23 assembler modules, 28 source procedures.
Page 495
Chapter 12: Symbol Display Symbol Display Options Data&Macros Search_All End_Options \ Symbol Display Options Data¯os Search_All End_Options \ Root is: @ecs 31 source and 23 assembler modules, 30 source procedures. Filename = ecs.x update_state_of\refresh : Type is Local int. Address = Frame + 8 update_state_of\interval_complete : Type is Local int.
Chapter 12: Symbol Remove Symbol Remove The Symbol Remove command removes the specified symbol from the symbol table. Only program symbols and user-defined debugger symbols can be deleted from the symbol table. To delete all symbols within a named module or function, append a backslash (\) to the module or function name (<...
Page 497
Chapter 12: Symbol Remove See Also Symbol Add Symbol Display Examples To delete symbol ’current_targets’ in function ’alter_settings’: Symbol Remove alter_settings\current_targets To delete all symbols in module ’updateSys’: Symbol Remove updateSys\ To delete symbol ’alter_settings’ in module ’updateSys’: Symbol Remove updateSys\alter_settings In this example, the symbol being removed is a function which contains other symbols.
Chapter 12: Trace Again Trace Again The Trace Again starts a trace using the last (previous) trace specification. The trace starts on the next program run or step command. If no trace has been previously specified, this command is equivalent to entering a Trace Trigger Never command, and states are collected until you enter a Trace Halt command.
Chapter 12: Trace deMMUer Trace deMMUer The Trace deMMUer command allows you to choose between tracing physical addresses and tracing logical addresses. You must enable the MMU before tracing MMU activity. The 68020/030 Graphical User Interface User’s Guide describes how to use the emulator configuration commands and the TC register to enable the MMU.
Page 500
Chapter 12: Trace deMMUer See Also The "Using MC68030 Memory Management" chapter in the 68020/030 Graphical User Interface User’s Guide. Examples To translate physical to logical addresses, make sure that the MMU has been set up, then enter: Trace deMMUer Load Verbose Trace deMMUer Enable To stop translating physical to logical addresses, enter: Trace deMMUer Disable...
Chapter 12: Trace Display Trace Display The Trace Display command displays trace information in the specified window. If no window is specified, the trace output will go to the Trace Mode window, and the debugger willl enter "trace mode."...
Page 502
Chapter 12: Trace Display Data may be displayed (interpreted) in several ways: from module and function entry and exit points, to raw bus data. The default display will show modules and source line references only. Trace mode In trace mode, the trace information is displayed in the View window. You cannot enter debugger commands from the command line while in trace mode.
Page 503
Chapter 12: Trace Display border of the Trace Mode window ( ^ or v ). The symbols show which direction the search will proceed through the trace buffer to find the next high-level or assembly code line (depending on the Code window selected). If the trace window has no lines that correspond to code lines, the search will proceed to the end of the trace buffer.
Page 504
Chapter 12: Trace Display Display qualifiers The following display qualifiers let you select what information is written to the output window and how the information is formatted. Line(s) Specifies the starting line or the range of lines to display or copy.
Page 505
Chapter 12: Trace Display Cycle used function code 0 Cycle used function code 3 Cycle used function code 4 Cycle refers to CPU space Cycle Type Code Fetch Cycle was a code fetch DMA cycle Cycle was a DMA cycle Read Cycle was a read cycle Write...
Page 506
Chapter 12: Trace Display Trace List Status Characters Character Description The indicated trace line is the trigger condition. The indicated trace line is an assembly language statement within a high-level statement, that is, not the first assembly language statement in the high-level source statement. The data field in the trace buffer line does not match the data in memory.
Chapter 12: Trace Event Clear_All Trace Event Clear_All The Trace Event Clear_All command clears (removes) all specified events that are not used by the trigger or store qualifier. See Also Trace Event Delete Examples To clear (remove) all defined trace events: Trace Event Clear_All...
Chapter 12: Trace Event Delete Trace Event Delete The Trace Event Delete command deletes (removes) a previously defined event specification. You cannot delete an event that is used by the trigger or store qualifier. See Also Trace Event Clear_All Trace Event Specify Examples To delete event 2: Trace Event Delete 2...
Chapter 12: Trace Event List Trace Event List The Trace Event List command lists the definition of the event specified by < event_nmbr> in the View window. The definition includes address, data, and status. The command used to define the event is listed, as well as an indication if the event is used by the trigger or qualifier.
Chapter 12: Trace Event Specify Trace Event Specify The Trace Event Specify command defines an event (detectable bus condition to be used for trace qualifying or triggering. The event number (< event_nmbr> ) must be a number between 1 and 30 inclusive. Bus...
Page 511
Chapter 12: Trace Event Specify conditions may be address values, data values, or status values. The event is true if all of the terms defined in the event are true at the same time. Event conditions Three types of conditions can be specified in an event definition. The three condition types are: Address The value that appears on the address bus.
Page 512
Chapter 12: Trace Event Specify A mask can be used to specify a range with a 32-bit value that marks valid bits in addresses or data. For example, to specify only addresses in the range 000015xxh (where xx are "don’t care" values), you could enter the command: Trace Event Specify 4 <Tab>...
Page 513
Chapter 12: Trace Event Specify To define event 2 to be any bus cycle corresponding to an instruction fetch from supervisor memory space: Trace Event Specify 2 <Tab> Status Is FnCde Supr CycTyp Fetch To define event 3 to be a write access of variable current_humid: Trace Event Specify 3 <Tab>...
Chapter 12: Trace Event Used_List Trace Event Used_List The Trace Event Used_List command lists the numbers of the events that are currently defined and whether or not the event is being used (specified in a Trace Trigger or Trace StoreQual definition). See Also Trace Event Specify Trace Trigger Event...
Chapter 12: Trace Halt Trace Halt The Trace Halt command stops (terminates) the trace currently being executed. If a trace is not in progress, this command has no effect. After executing this command, you can display any trace data collected. See Also Trace Again Examples...
Chapter 12: Trace StoreQual Trace StoreQual The Trace StoreQual command immediately specifies the bus conditions to be stored (captured) in the trace buffer. Bus conditions may be address values,...
Page 517
Chapter 12: Trace StoreQual data values, or status values. When you define a storage qualifier, you are essentially defining an event. You can also use the Trace Event Specify command to define an event, and then use the Trace StoreQual Event command to use the specified event as a storage qualifier term.
Page 518
Chapter 12: Trace StoreQual 0x000015xx (where xx are "don’t care" values), you could enter the command: Trace StoreQual Address Is 0x1500 &= 0xffffff00 where &= is the bit mask operator. This format is used because the C language does not have a way to represent a don’t care literal.
Page 519
Chapter 12: Trace StoreQual Prestore Specifying Prestore in your storage qualifier definition causes the trace function to store up to two instruction fetch cycles preceding the qualified condition being stored. This lets you view the instructions leading up to the qualified state.
Chapter 12: Trace StoreQual Event Trace StoreQual Event The Trace StoreQual Event command lets you specify an event or combination of events defined with the Trace Event Specify command as the storage qualifier. Events Each event that you define using the Trace Event Specify command is assigned an event number between 1 and 30.
Page 521
Chapter 12: Trace StoreQual Event To store only states matching event 1 or event 2 defined with the Trace Event Specify command: Trace StoreQual Event 1 <Tab> Or 3...
Chapter 12: Trace StoreQual List Trace StoreQual List The Trace StoreQual List command displays the current storage qualification definition in the View window. See Also Trace StoreQual Trace StoreQual event Examples To list the current storage qualification definition in the View window: Trace StoreQual List...
Chapter 12: Trace StoreQual None Trace StoreQual None The Trace StoreQual None command causes the trace function to store all bus cycles (no trace qualification). See Also Trace StoreQual Trace StoreQual event Examples To store all bus cycles (no trace qualification): Trace StoreQual None...
Page 525
Chapter 12: Trace Trigger The Trace Trigger command specifies the bus conditions to be used as the trigger condition. Bus conditions may be address values, data values, or status values. When you define a trigger, you are essentially defining an event. You can also use the Trace Event Specify command to define an event, and then use the Trace Trigger Event command to use the specified event as the trigger event.
Page 526
Chapter 12: Trace Trigger A mask can be used to specify a range with a 32-bit value that marks valid bits in addresses or data. For example, to trigger only on addresses in the range 0x000015xx (where xx are "don’t care" values), you could enter the command: Trace Trigger Address Is...
Page 527
Chapter 12: Trace Trigger Center The trigger is centered in the trace buffer. The trigger is at the end of the trace buffer. The trigger state will always be line number 0 in the trace list. Interaction with trace commands The Trace Trigger, Breakpt Access, Breakpt Read, and Breakpt Write commands all require use of emulation analyzer resources.
Chapter 12: Trace Trigger Event Trace Trigger Event The Trace Trigger Event command lets you specify an event or combination of events defined with the Trace Event Specify command as a trigger condition. The trigger condition can be a single event, a logically OR’ed combination of events, a specified number of occurrences of an event or combination of events, or a sequence of the preceding conditions.
Page 529
Chapter 12: Trace Trigger Event Keywords The Or keyword lets you specify a logically OR’ed combination of events as the trigger condition. Count The Count keyword specifies the number of times ( <nmbr_times> ) an event or OR’ed combination of events must occur before the debugger proceeds to the next trigger sequence term or before the trigger condition is completed.
Page 530
Chapter 12: Trace Trigger Event Trace Trigger Event 1 To trigger on the occurrence of either event 1 or event 3 (events 1 and 3 must have been previously defined with the Trace Event Specify command): Trace Trigger Event 1 <Tab> Or 3 To trigger on the fifth occurrence of event 3 following an occurrence of event 1 (events 1 and 3 must have been previously defined with the Trace Event Specify command):...
Chapter 12: Trace Trigger List Trace Trigger List The Trace Trigger List command displays the current trigger definition in the View window. See Also Trace Trigger Trace Trigger List Trace Trigger None Examples To list the current trigger definition in the View window: Trace Trigger List...
Chapter 12: Trace Trigger Never Trace Trigger Never The Trace Trigger Never command sets the trace function up to collect states until you stop the trace using the Trace Halt command. Collection starts on the next program run or step command. See Also Trace Halt Examples...
Chapter 12: Window Active Window Active The Window Active command activates the specified window. The border of the active window is highlighted. The Code window is active by default within the high level and low level screens.
Page 534
Chapter 12: Window Active The Next and Previous parameters specify the next higher-numbered or lower-numbered window relative to the active window. The cursor keys and the F4 function key only operate in the active window. The Error, Help, and Status windows cannot be made active. See Also Window Cursor Window Delete...
Chapter 12: Window Cursor Window Cursor The Window Cursor command sets the cursor position in the window specified by < user_window_nmbr> . The top left corner of the window is represented by coordinates 0,0. Subsequent output to the window begins at the cursor position. Only user-defined windows and the standard I/O window (window No.
Chapter 12: Window Delete Window Delete The Window Delete command removes a window (possibly a screen) defined previously with the Window New command. Remove a window by entering the window’s associated window number. If you do not specify a window number or if you specify 0, the active window is removed.
Chapter 12: Window Erase Window Erase The Window Erase command clears all displayed information in the specified window. It then places the cursor in the specified window to the 0,0 position. If you do not specify a window number or if you specify 0, the active user-defined window is cleared.
Chapter 12: Window New Window New The Window New command makes (creates) new windows and screens. It may also be used to move existing windows to a new location within a screen. Windows must be assigned a number between 50 and 256 inclusive. Numbers 1 through 49 are reserved for predefined debugger windows.
Page 539
Chapter 12: Window New Command Parameters Definition of the Window New command parameters are as follows: Parameter Definition Range 50 to 256 inclusive < user_window_nmbr> Window number < user_screen_nmbr> User_Screen 4 to 256 inclusive < top row> Upper row coordinate 0 to N-1 inclusive <...
Page 540
Chapter 12: Window New Window Screen_On Window Toggle_View Examples To make a new user window, number it 57, and display it in user screen 4 with upper-left corner at coordinates 5,5 and the lower right corner at coordinates 18,78: Window New 57 User_Screen 4 Bounds 5,5,18,78 To make a new user window, number it 55, and display it in the high-level screen with upper-left corner at coordinates 5,5 and the lower right corner at coordinates 10,20:...
Chapter 12: Window Resize Window Resize The Window Resize command lets you change the size and position of the active window interactively. The cursor keys (left, right, up, and down arrows) move either the top left corner, or the bottom right corner of the window. To reposition the top left corner, press T and position the top left corner of the window using the cursor control keys.
Page 542
Chapter 12: Window Screen_On Window Screen_On The Window Screen_On command displays the selected screen. You can also use function key F6 to display a screen. If the high level screen is displayed, the debugger is placed in the high level mode.
Page 543
Chapter 12: Window Toggle_View Window Toggle_View The Window Toggle_View command selects the alternate view of a window. Typically, this is an enlarged view of the window. If you do not specify a window number or if you specify 0, the active window is the default. When you execute the Window Toggle_View command, the display alternates between the two views of the window.
Page 544
Chapter 12: Window Toggle_View You can also use the F4 function key to alternate views of the active window. To create alternate views of a user-defined window, follow the procedure outlined in the Window New command description. See Also Window Active Window Cursor Window Delete Window Erase...
Expressions and Symbols in Debugger Commands A description of the expressions and symbols you can use in debugger commands.
Page 546
Chapter 13: Expressions and Symbols in Debugger Commands Expressions and Symbols in Debugger Commands This chapter discusses the following language elements used in debugger commands: • Expression elements. • Formatting expressions. • Symbolic referencing. Debugger commands use standard C operators and syntax. This chapter describes the elements of C expressions and how expressions are structured.
Chapter 13: Expressions and Symbols in Debugger Commands Expression Elements Expression Elements Most debugger commands require simple C expressions that evaluate to a scalar value. Simple C expressions are the same as standard algebraic expressions. These expressions evaluate to a single scalar value. Expressions consist of the following elements: •...
Page 548
Chapter 13: Expressions and Symbols in Debugger Commands Expression Elements Supported C Operators Operators Order of Association Left to right -> Right to left sizeof (type) – & Left to right Left to right – Left to right << >> Left to right <...
Chapter 13: Expressions and Symbols in Debugger Commands Expression Elements Debugger Operators Operator Description References the contents of a memory location. For example: Expression Display_Value [0x20b0] Identifies a line number. For example: Program Run Until #82 Identifies a stack level, reserved symbols, or symbol tree root. For example: Program Display_Source @2 (stack level) Expression Display_Value @module...
Page 550
Chapter 13: Expressions and Symbols in Debugger Commands Expression Elements Integer Constants. An integer constant may be defined as a sequence of numeric characters optionally preceded by a plus or minus sign. If unsigned, the debugger assumes the value is positive. Positive integer constants may range between 0 and 2**31-1.
Page 551
Chapter 13: Expressions and Symbols in Debugger Commands Expression Elements The examples given in the following table show the use of prefix and suffix descriptors. Prefix and Suffix Descriptor Examples Constant Decimal Mode Hexadecimal Mode Decimal Decimal 0EFF1h Hexadecimal Hexadecimal Binary Hexadecimal 0x2214...
Page 552
Chapter 13: Expressions and Symbols in Debugger Commands Expression Elements Examples: 76.3e-1 76.3 –0.3e1 76.3E+0 76.e5 76.3E2 Character Strings and Character Constants Character Strings. A character string is a sequence of one or more ASCII characters enclosed in double quotation marks or two or more characters enclosed in single quotes.
Page 553
Chapter 13: Expressions and Symbols in Debugger Commands Expression Elements Non-Printable Character Escape Sequences Sequence ASCII Name Hex Value Description Back Space Form Feed New Line Carriage Return Horizontal Tab \" " Double Quote Backslash \xnumber –– xnumber Hex Character Value \xnumber must be entered in the format \xnn where nn is a two digit hexadecimal value.
Chapter 13: Expressions and Symbols in Debugger Commands Symbols Symbols A symbol (also called an identifier) is a name that identifies a location in memory. It consists of a sequence of characters that identify program and debugger variables, macros, keywords,registers, memory addresses, and line numbers.
Chapter 13: Expressions and Symbols in Debugger Commands Symbols counterpart(_main). However, with symbols on demand, only the high-level symbol is available (main). Debugger Symbols Debugger symbols can be added during a debugging session using the Symbol Add command. The debugger treats debugger symbols as global symbols. When you create a debugger symbol, you must assign it a name.
Chapter 13: Expressions and Symbols in Debugger Commands Symbols Reserved Symbols Reserved symbols are reserved words that represent processor registers, status bits, and debugger control variables. These symbols are always recognized by the debugger. You can use reserved symbols any time during a debugging session.
Chapter 13: Expressions and Symbols in Debugger Commands Addresses Addresses An address may be represented by any C expression that evaluates to a single value. The C expression can contain symbols, constants, line numbers, and operators. Code Addresses Code addresses refer to the executable portion of a program. In high level mode, expressions that evaluate to a code address cannot contain numeric constants or operators.
Page 558
Chapter 13: Expressions and Symbols in Debugger Commands Addresses To display code as bytes starting at line number 82 and ending at address 10d0 (hex): Memory Display Byte #82..0x10d0 To display code as bytes, starting at memory location tick_clock and ending at 20 bytes past tick_clock: Memory Display Byte tick_clock..+20...
Chapter 13: Expressions and Symbols in Debugger Commands Keywords Keywords Keywords are macro conditional statements that can be used in a macro definition. These keywords are very similar to the C language conditional statements. You cannot redefine keywords or use them in any other context. The debugger keywords are listed below.
Chapter 13: Expressions and Symbols in Debugger Commands Forming Expressions Forming Expressions The debugger groups expressions into two classes: • Assembly language expressions used in assembly level mode. • Source language expressions used in either assembly level mode or high level mode.
Chapter 13: Expressions and Symbols in Debugger Commands Expression Strings Valid Expressions Expression Meaning Line number reference (code address) Symbol reference (value or address) x+ (y*5) Arithmetic operation (value or address) default_targets[2] Array reference (value or address) assign_vectors Function name reference (code address) Expression Strings An expression string is a list of values separated by commas.
Chapter 13: Expressions and Symbols in Debugger Commands Symbolic Referencing Symbolic Referencing The debugger references symbols in a different manner than the standard C language definition. Therefore, understanding how variables are allocated and stored in memory is important. The following sections describe symbol storage classes and data types.
Chapter 13: Expressions and Symbols in Debugger Commands Symbolic Referencing In C, static variables local to a module can only be accessed by functions in that module. In the debugger, static variables local to a module can be accessed either when a function is active in that module or when the variable is qualified by the module name in which it is defined.
Page 564
Chapter 13: Expressions and Symbols in Debugger Commands Symbolic Referencing debugger treats these types as unsigned char, unsigned short int, and unsigned long, respectively. A segment attribute indicates whether a variable was defined in a code segment or a data segment. Source language modules may contain any valid C language data type.
Page 565
Chapter 13: Expressions and Symbols in Debugger Commands Symbolic Referencing High Level Complex Data Types Type Size struct Combined size of members (plus possible padding) union Size of largest member array Combined size of elements Type Conversion The debugger does data type conversions under the following conditions: •...
Chapter 13: Expressions and Symbols in Debugger Commands Symbolic Referencing Unlike C, the debugger allows casting to an array. The following example casts the address of the symbol int_value to an array of four chars: (char[4]) &int_value This type of casting to an array can be used with both the Expression Display_Value and Expression Monitor_Value commands.
Chapter 13: Expressions and Symbols in Debugger Commands Symbolic Referencing (H W) This type cast coerces an expression into a word (2 bytes). For example, assuming the symbol int_val has the value 0x12345678, Expression Display_Value (H W) int_val will cause int_val to be displayed as 0x5678. (H B) This type cast coerces an expression into a byte.
Page 568
Chapter 13: Expressions and Symbols in Debugger Commands Symbolic Referencing Non-program symbol tree. This tree is composed of non-program symbols. Only one non-program symbol tree exists. This tree is made up of: • debugger symbols (@pc, @sp, etc.) • macros •...
Page 569
Chapter 13: Expressions and Symbols in Debugger Commands Symbolic Referencing Module Names The C language does not contain the concept of a module. Within the context of the debugger, a module is a scoping level which is identical to the scoping level of a file in C.
Page 570
Chapter 13: Expressions and Symbols in Debugger Commands Symbolic Referencing Symbolic Referencing With Explicit Roots Example Comment Display symbols scoped under the non-program Symbol Display Default \\ root. Display symbols scoped under the program root Symbol Display Default @a_out\\ a_out. Display symbols scoped under the current root.
Chapter 13: Expressions and Symbols in Debugger Commands Symbolic Referencing Symbolic Referencing With Explicit Roots Example Comment Notes: The variable mod1 must be a module name. The variable func1 must be a function name. The example pairs are equivalent if the current root is a_out. Symbolic Referencing Without Explicit Roots Example Comment...
Chapter 13: Expressions and Symbols in Debugger Commands Symbolic Referencing • Function names and labels evaluate to addresses. • Variables generally evaluate to the contents of the memory location at the address of the variable (the exception is unsubscripted array names which evaluate to addresses.) The examples in the following table show the differences in evaluation of these symbol types.
Page 573
Chapter 13: Expressions and Symbols in Debugger Commands Symbolic Referencing • To refer to variables on the stack in the current function, specify the name of the variable. For example: x. • To refer to a local variable in a nested function, specify the function name followed by a backslash and then the name of the local variable, for example, main\i.
Page 574
Chapter 13: Expressions and Symbols in Debugger Commands Symbolic Referencing...
Page 576
Chapter 14: Reserved Symbols The symbols listed in this chapter are predefined, reserved symbols for the 68020/030 debugger/emulator. Symbols identified with an asterisk (*) are used only with the 68030 processor. Reserved symbols cannot be deleted by the user. Note that reserved symbols may be entered in either upper or lower case characters.
Page 577
Chapter 14: Reserved Symbols Reserved Symbols Symbol Meaning Maximum Value @A0-A7 Address Registers 0xFFFFFFFF @AC0 Access Control Register 0 (68EC030 only) 0xFFFFFFFF @AC1 Access Control Register 1 (68EC030 only) 0xFFFFFFFF @ACUSR Access Control Unit Status Register (68EC030 only) 0xFFFF Carry Flag @CAAR Cache Address Register 0xFFFFFFFF...
Page 578
Chapter 14: Reserved Symbols Reserved Symbols Symbol Meaning Maximum Value @VBR Vector Base Address 0xFFFFFFFF Extend Flag Z ero Flag...
Page 580
Predefined Macros Predefined macros are provided with the debugger. These predefined macros provide commonly used functions to help in debugging your program. The predefined macros available for your use are listed in the “Predefined Debugger Macros” table and are described on the following pages. The following predefined debugger macros provide services to the SIMIO system and internal debugger functions.
Chapter 15: Predefined Macros Predefined Debugger Macros Macro Description break_info Display information about a breakpoint byte Return a byte value at the specified address Call target function (not implemented in this product) call close Close a UNIX file cmd_forward Send a command to another attached emulator interface Return a long value at the specified address dword error...
Page 582
Chapter 15: Predefined Macros break_info break_info Function Return information about a breakpoint Synopsis int break_info (addr) unsigned long *addr; Description The break_info macro returns the address and type of a breakpoint if it is called when a breakpoint is encountered. The macro returns the 32-bit representation of the breakpoint address used by the debugger and the following values for breakpoint type: The cause of the breakpoint is unknown.
Page 583
Chapter 15: Predefined Macros break_info Example If you have the following code segment: main() auto i,j,k; i = 1; j = 3; k = i + j; and you execute the following command file: Debugger Macro Add int print_info() unsigned long address; int reason;...
Chapter 15: Predefined Macros byte byte Function Return a byte value at the specified address Synopsis unsigned char byte (addr) void *addr; Description The byte macro returns a byte value of the memory contents at the specified address. The value of the expression addr is computed and used as the address. Diagnostics The byte value of the memory contents at the specified address is returned.
Description The close macro closes a UNIX file. This macro is an interface to the UNIX system call close(2). Refer to the HP-UX Reference Manual for detailed information. Diagnostics If the system call to close(2) is successful, 0 is returned. Otherwise, -1 is returned and a system generated error message is written to the journal window of the debugger.
Chapter 15: Predefined Macros cmd_forward cmd_forward Function Send a comand to another attached emulator interface. Synopsis int cmd_forward (ui_id, command) char *ui_id; char *command; Description This macro sends the string command to the interface ui_id. Interface ui_id will then interpret command as input to its command line. This macro provides a way for the target program to send commands to an emulator interface, as well as allowing control of all interfaces from a common point.
Page 587
Chapter 15: Predefined Macros cmd_forward Examples To start execution of an emulator interface command file at the beginning of sub-program main5, enter: Breakpoint Instr main5; cmd_forward ("emul", "my_command_file") To provide a target function to send a command to a user interface, compile the following function into your target program: void send_command (ui, cmd) char *ui, *cmd;...
Chapter 15: Predefined Macros dword dword Function Return a long value at the specified address Synopsis unsigned long dword (addr) void *addr; Description The dword macro returns a LONG (4-byte) value of the memory contents at the specified address. The value of the expression addr is computed and used as the address.
Chapter 15: Predefined Macros error error Function Display error message Synopsis void error(level, text, parm) level; char *text; long parm; Description The error() macro is used to display error messages due to errors generated within macros. level must have a value of 1, 2, or 3. text is a string which can contain one %d format character, where parm is the associated integer value.
Chapter 15: Predefined Macros fgetc fgetc Function Reads character from file Synopsis int fgetc(vp_num) int vp_num; Description The macro fgetc() returns the next character in the file associated with the window number vp_num. The window number must be a result of the File User_Fopen command.
Chapter 15: Predefined Macros fopen fopen Function Open a file and associate it with a user window Synopsis int fopen(vp_num, filename, mode) vp_num; char *filename; char *mode; Description The macro fopen() opens a file and associates it with a user-defined window. This macro is equivalent to the File User_Fopen debugger command.
Chapter 15: Predefined Macros key_get key_get Function Get a key from the keyboard Synopsis unsigned short key_get() Description The macro key_get() reads a key from the keyboard. It returns only after a key is available. The return value is the value of the key.
Chapter 15: Predefined Macros key_stat key_stat Function Check keyboard for availability of key Synopsis unsigned short key_stat() Description The key_stat() macro checks the keyboard to see if a key is available to read. It returns 0 if no key is available. The first pending key is returned if any keys are available.
Chapter 15: Predefined Macros memchr memchr Function Search for character in memory Synopsis char *memchr (str1, byte_value, count) char *str1; char byte_value; unsigned count; Description The memchr macro locates the character byte_value in the first count bytes of memory area str1. Diagnostics The memchr macro returns a pointer to the first occurrence of character byte_value in the first count characters in memory area str1.
Chapter 15: Predefined Macros memclr memclr Function Clear memory bytes Synopsis char *memclr (dest, count) char *dest; unsigned count; Description The memclr macro sets the first count bytes in memory area dest to zero. Diagnostics The memclr macro returns dest.
Chapter 15: Predefined Macros memset memset Function Set the value of characters in memory Synopsis char *memset (dest, byte_value, count) char *dest; char byte_value; unsigned count; Description The memset macro sets the first count characters in memory area dest to the value of character byte_value.
These modes may be combined be adding the appropriate values together. This macro is an interface to the UNIX system call open(2). Refer to the HP-UX Reference Manual for detailed information. Diagnostics If the system call to open(2) is successful, the system file descriptor is returned.
Page 599
Chapter 15: Predefined Macros open Example The following command file segment defines two global debugger symbols and includes the definition of a user-defined macro that uses open(). Symbol Add int infile Symbol Add int outfile Debugger Macro Add int open_files(infile, outfile) char *infile;...
Chapter 15: Predefined Macros pod_command pod_command Function Send terminal interface commands to the emulator Synopsis pod_command(command, response) char *command, *response; Description The pod_command macro sends the string in command to the emulator, and puts any response text in response. If multiple lines of text are returned, the lines are separated in response with a new line (\n) character.
Page 601
Chapter 15: Predefined Macros pod_command Examples To get the first 99 characters of emulator version information: Symbol Add char resp[100] Debugger Macro Call pod_command("ver",resp) Expression Printf "%s",resp To send the emulator "help" command and ignore output: Debugger Macro Call pod_command("help",0) To send an invalid command to the emulator: Debugger Macro Call pod_command("silly",0)
Description The read macro reads from a system file. This macro is an interface to the UNIX system call read(2). Refer to the HP-UX Reference Manual for detailed information. Diagnostics If the system call to read(2) is successful, the number of bytes read is returned.
Chapter 15: Predefined Macros reg_str reg_str Function Get register value Synopsis unsigned long reg_str(str1) char *str1; Description The reg_str macro gets the contents of a register using a string variable representation of its name. This is not possible using standard debugger commands.
Chapter 15: Predefined Macros showversion showversion Function Show the software version number for the debugger product Synopsis void showversion () Description The showversion macro lists the software version number for your debugger product.
Chapter 15: Predefined Macros strcat strcat Function Concatenate two strings Synopsis char *strcat (dest, src) char *dest, *src; Description The strcat macro appends a string to the end of another string. The string in src is appended to the string in dest and a pointer to dest is returned. Diagnostics No checking is done on the size of dest.
Chapter 15: Predefined Macros strchr strchr Function Locate first occurrence of a character in a string Synopsis char *strchr (str1, byte_value) char *str1; char byte_value; Description The strchr macro returns a pointer to the first occurrence of the character byte_value in the string str1, if byte_value occurs in str1. Diagnostics If the character byte_value is not found, strchr returns a NULL pointer.
Chapter 15: Predefined Macros strcmp strcmp Function Compare two strings Synopsis unsigned long strcmp (str1, str2) char *str1, char *str2; Description The strcmp macro compares strings in lexicographic order. Lexicographic order means that characters are compared based on their internal machine representation.
Chapter 15: Predefined Macros strcpy strcpy Function Copy a string Synopsis char *strcpy (dest, src) char *dest, char *src; Description The strcpy macro copies src to dest until the NULL character is moved. (Copying from the right parameter to the left resembles an assignment statement.) A pointer to dest is returned.
Chapter 15: Predefined Macros stricmp stricmp Function Comparison of two strings without case distinction Synopsis unsigned long stricmp (str1, str2,) char *str1; char *str2; Description The stricmp macro compares str1 with str2 without case distinction. This means that the strings "ABC" and "abc" are considered to be identical. The strings str1 and str2 are compared and a result is returned according to the following relations: relation...
Chapter 15: Predefined Macros strlen strlen Function String length Synopsis unsigned long strlen (str1) char *str1; Description The strlen macro returns the length of a string. It returns the length of str1, excluding the NULL character. Diagnostics If str1 is not properly terminated by a NULL character, the length returned is invalid.
Chapter 15: Predefined Macros strncmp strncmp Function Limited comparison of two strings Synopsis unsigned long strncmp (str1, str2, count) char *str1; char *str2; unsigned count; Description The strncmp macro compares strings in lexicographic order. Lexicographic order means that characters are compared based on their internal machine representation.
Chapter 15: Predefined Macros until until Function Run until expression is true Synopsis char until (boolean) int boolean; Description The until macro returns a zero when boolean is nonzero. The Until macro is used with the Program Run and Program Step With_Macro commands. It halts execution when the expression passed is true, and continues when the expression passed is false.
Chapter 15: Predefined Macros when when Function Break when expression is true Synopsis char when (boolean) int boolean; Description The when macro returns a zero when boolean is nonzero; it returns a one when boolean is zero. This macro is used with the Breakpt Instr command. When used with this command, program execution will halt when the stated expression is true, and will continue when the stated expression is false.
Chapter 15: Predefined Macros word word Function Return a word value at the specified address Synopsis unsigned short int word (addr) void *addr; Description The word macro returns a WORD (2-byte) value of the memory at the specified address. The value of the expression addr is computed and used as the address.
Description The write macro writes to a system file. This macro is an interface to the UNIX system call write(2). Refer to the HP-UX Reference Manual for detailed information. Diagnostics If the system call to write(2) is successful, the number of bytes written is returned.
Debugger Error Messages A list of the error messages generated by the debugger.
Page 618
Chapter 16: Debugger Error Messages The debugger displays the error window whenever it detects a command error. The debugger displays an error message and a pointer to the location where it detected the error. This chapter lists and describes the error messages and warnings issued by the debugger.
Page 619
Chapter 16: Debugger Error Messages Invalid characters follow command. A command was entered with incorrect characters or with more characters than were expected. Check the command name and re-enter the command. This command is not implemented yet. The command specified is currently not supported, but will be implemented in a later release.
Page 620
Chapter 16: Debugger Error Messages Missing ’ ( ’, ’ [ ’, or ’ { ’ in expression. The matching left parentheses, left bracket, or left curly brace in the specified expression is missing. Check the expression and add the appropriate left delimiter.
Page 621
Chapter 16: Debugger Error Messages Invalid instruction address. This error occurs mainly in high-level mode. In high-level mode, this error will occur if the instruction address is not a function name or line number. Code addresses in high-level mode may not be numeric or expressions. In assembly-level mode, most instruction address values are legal.
Page 622
Chapter 16: Debugger Error Messages Invalid screen specification. The command entered contains a screen specification that does not correspond to the screen where the specified window is located, or the specified screen does not exist. The screen number should be verified. Invalid window specification.
Page 623
Chapter 16: Debugger Error Messages Cannot divide by zero. An attempt was made to divide by zero within an expression of Expression Display_Value or Expression C_Expression. This command cannot be used in this mode. A command that is not supported in the current mode was issued. The Program Display_Source command is only supported in high-level mode, and the Memory Display Mnemonic command is only supported in assembly-level mode.
Page 624
Chapter 16: Debugger Error Messages Symbol not found. The symbol name was entered incorrectly, or the symbol does not exist. The symbol name may have been mistyped. Macro not found. The specified macro has not been defined, or an invalid macro name was entered.
Page 625
Chapter 16: Debugger Error Messages Port output does not go to a file. Only port output directed to a file may be rewound with the Memory Port Rewind Output command. This breakpoint is already set. An attempt was made to set a breakpoint that already exists. The current breakpoint must be deleted before it can be reset.
Page 626
Chapter 16: Debugger Error Messages Invalid level number. Must be 1 to 7. The Program Interrupt Add command, as well as the 68020 family of microprocessors, permit 7 levels of interrupts. Attempt to delete nonexistent breakpoint(s). You tried to clear a breakpoint that was not previously set. Check that the breakpoint was set, or not already cleared.
Page 627
Chapter 16: Debugger Error Messages Invalid processor name. This error indicates that you specified a processor other than one supported by your debugger. See your user’s guide for a list of supported microprocessors. Breakpoint limit exceeded. The number of breakpoints allowed has been exceeded. This breakpoint has not been set.
Page 628
Chapter 16: Debugger Error Messages Cannot build disassembly table. There is not sufficient memory available to build the disassembly table for up-arrow and page-up support in the disassembler. Cannot split monitor lines. An attempt was made to monitor different elements on the same line. Only one element per line may be monitored.
Page 629
Chapter 16: Debugger Error Messages Not a color monitor. Not used. Not enough memory. This error indicates that not enough memory was available for the specified command. Terminated when processing absolute file. This error indicates that an invalid control value was encountered in loading the ".x"...
Page 630
Chapter 16: Debugger Error Messages This command not allowed from a macro. Some commands are not allowed from a macro, such as Debugger Host_Shell and Debugger Macro Add. Invalid float expression, results in NAN. A floating point expression resulted in a non-number. Cannot convert float value.
Page 631
Chapter 16: Debugger Error Messages Cannot create file for logging. This error indicates that there was an error when trying to create the specified log file or that the current directory does not have write permission. Write error occurred while writing to a file. This error indicates that the disk is probably full.
Page 632
One possible error message is: No valid BBA spec file for < processor> processor You must have the HP Branch Validator product for your processor installed on your system in order to use the Memory Unload_BBA command. Miscellaneous warning.
Page 633
Chapter 16: Debugger Error Messages Miscellaneous note. All available information is displayed on the screen. Any one of a number of notice messages may be displayed on your screen. Too many interrupts pending. Too many Program Interrupt commands have been given without a sufficient number of interrupts being processed.
Page 634
Chapter 16: Debugger Error Messages Cannot save into this address (not ’lvalue’). This command can only save at an address which is an ’lvalue’. Check the address and then retry the command. Invalid type for macro argument. This is an invalid type for the macro argument. Refer to the chapter on macros for more information on valid types for macro arguments.
The debugger’s old standard interface may still be used. New Product Number The old product number of this debugger was HP 64372 for HP 9000 Series 300 computers. The new number is HP B1476. New Reserved Symbols @ENTRY is the address of the first executable statement in a function.
Chapter 17: Debugger Versions Environment Variable Expansion Operating system environment variables will now be expanded when they appear in a debugger command. For example, "Debugger Directory Change_working $HOME/test" will now work as expected. Target Program Function Calls You may now reference target program functions in C expressions. Target and debugger variables may be passed by value, and target variables may be passed by reference.
Chapter 18: Installation Installation at a Glance Installation at a Glance The debugger/emulator is a tool for debugging C programs for 68020/030 series microprocessors in a emulation execution environment. Follow these steps to install the debugger/emulator: 1 Install the software on your computer. 2 Install the emulator hardware.
Supplied filesets As you install the software, you will see a list of the filesets on the tape. The filesets are identified by their HP product number. The tape may contain several products. Usually, you will want to install all of the products on the tape.
16 megabytes of memory. Series 300 workstations should have a minimum performance equivalent to that of a HP 9000/350. A color display is also highly recommended. • Approximately 3 Mbytes of disk space.
• You were shipped the HP B1471 64000-UX Operating Environment instead of the HP B1471 64700 Operating Environment, you were shipped files that are not necessary to the operation of the debugger/emulator. Excluding these files will save you about 4.5 megabytes of disk space.
Page 646
/etc/update at the HP-UX prompt. 6 When the HP-UX update utility main screen appears, confirm that the source and destination devices are correct for your system. Refer to your HP-UX System Administration documentation if you need to modify these values.
Page 647
Chapter 18: Installation To install software on an HP 9000 system • View the filesets in the emulator-specific partition (named something like 68020/030 Series debugger/emulator). • Mark the XUI fileset with “n” to exclude it from installation. • Mark all other filesets in the partition with “y” to confirm installation.
Administration manual. • At least 16 megabytes of memory (for the graphical user interface). • Color display (optional, but recommended for the graphical user interface). • Approximately 3 Mbytes of disk space. • The emulator hardware. • HP B1476B debugger/emulator software.
Step 1: Install the software For instructions on how to install software on your SPARCsystem, refer to the HP 64000-UX for SPARCsystems— Software Installation Guide. Normally you should install all of the filesets on the tape. If you do not wish to install the graphical interface, install everything except the XUI suffixed filesets.
Page 650
Chapter 18: Installation To install the software on a Sun SPARCsystem™ If you want to continue using the F1 key for HELP, you can use use F2-F9 for the Softkey Interface. All you have to do is set the KEYMAP variable. If you use OpenWindows, type: setenv KEYMAP sun.2-9 If you use xterm windows (the xterm window program is located in the...
Turn to the HP 64700 Series Installation/Service Guide and follow the instructions for installing emulator, memory, or analyzer cards in the HP 64700 Series Cardcage. It may be that you already have installed the cards in the cardcage or your cardcage came with cards already installed.
Windows application. A window manager is not required to execute the interface, but, as a practical matter, you must use some sort of window manager with the X server. • If you are using an HP workstation, start the X server and the Motif window manager by entering: x11start •...
To set up your software environment To start HP VUE If you will be using the X server under HP VUE and have not started HP VUE, do so now. HP VUE differs slightly from other window managers in that it does not read your .Xdefaults file to find resources you may want to customize.
• Set the PATH environment variable to include the usr/hp64000/bin directory. • Set the HP64_DEBUG_PATH environment variable. For the ksh login shell (most HP systems), set a variable by entering export <variable>=<value> For the csh login shell (most Sun systems), set a variable by entering setenv <variable>...
Page 655
If your system is named "myhost," set the display variable by typing: export DISPLAY=myhost:0.0 If you installed the HP 64000 software in the root directory, "/", enter: export HP64000=/usr/hp64000 export PATH=$PATH:$HP64000/bin If you installed the software in the directory /users/team, enter:...
64700tab.net file is placed in the directory as part of the installation process. 1 Display the 64700tab.net file by entering more /usr/hp64700/etc/64700tab.net at the HP-UX prompt. 2 Page through the file until you find the emulator you are going to use.
3 Edit the /usr/hp64000/etc/64700tab.net file and add a line for the emulator. The new line should look like one of the examples given on the previous page. See Also The HP 64700A Card Cage Installation/Service Guide. The 64700tab on-line manual page.
Chapter 18: Installation To set up your software environment To add an emulator to the /etc/hosts file • If the emulator is connected via a LAN, edit the /etc/hosts file to add a line consisting of the emulator’s Internet Address (IP Address) and name.
1 Verify the existence of the HP64_Debug file in the /usr/lib/X11/app-defaults subdirectory by entering ls /usr/lib/X11/app-defaults/HP64_Debug at the HP-UX prompt. Finding this file verifies that you loaded the correct fileset and also verifies that the customize scripts executed because this file is created from other files during the customize process.
To verify the software installation To remove software 1 Find the fileset name of the product you wish to remove. To see a list of the fileset names which you can remove, on an HP-UX system type: ls /etc/filesets Or, on a Sun system, type:...
$TERM The term variable is usually set by the login process (usually by /etc/profile). See the HP-UX System Administration Task Manual for more information on adding Peripheral Devices (terminals and modems). The following table shows the supported configurations for: •...
Page 662
RS-232 Terminals. RS-232 terminals interface to HP-UX by means of HP 98626, HP 98642, or HP 98629 RS-232 interface cards. RS-232 terminals and bit mapped displays should be added to HP-UX according to the instructions in the HP-UX System Administration Task...
Page 663
However, it defaults this character set to a font other than the HP line drawing font unless the line drawing font is explicitly specified as the alternate character set when the window is started.
Page 664
Chapter 18: Installation Configuring Terminals for Use with the Debugger Softkey Softkey Softkey Softkey – Softkey Softkey Softkey Softkey Roll Next Insert Delete Page Char Char, Enter Roll Prev Unused Down Page Clear Command Line Recall DEC Terminal Top Row Function Keys (ESC) (BS) (LF)
Chapter 18: Installation Configuring Terminals for Use with the Debugger To configure HP terminals or bit-mapped displays 1 Press the System key. (New function labels appear.) 2 Press the Config Keys key. (New function labels appear.) 3 Press the Terminal Config key.
Page 666
Chapter 18: Installation Configuring Terminals for Use with the Debugger 6 Save the configuration by pressing the SAVE CONFIG key. All other terminal configuration options are user-definable. Note With bit-mapped displays, you may need to set the function keys to user mode by holding down the shift key and then pressing the user key.
Chapter 18: Installation Configuring Terminals for Use with the Debugger To configure the DEC VT100 terminal You must configure two menus in order for the VT100 display to work properly: SET-UP A and SET-UP B. SET-UP A 1 Press SET-UP to enter the setup menu. 2 Press 80/132 COLUMNS to select 80 columns per line.
Page 668
Chapter 18: Installation Configuring Terminals for Use with the Debugger 5 Using the arrow keys, position the cursor at the SET-UP feature to be changed. 6 Press TOGGLE 1/0 to select the feature. Do this for the four features shown below: 7 Press SET-UP to exit SET-UP B.
Chapter 18: Installation Configuring Terminals for Use with the Debugger To configure the VT220 terminal There are three menus that you must set up in order for the VT220 display to work properly: • Display • General • Comm From the power-on condition, press the SET-UP key to move into the initial SET-UP directory.
Page 670
Chapter 18: Installation Configuring Terminals for Use with the Debugger 4 Position the cursor at the Comm SET-UP field. Press Enter. Position the cursor at the L ocal Echo field. This field must be set to No L ocal Echo. 5 Position the cursor at the To Directory field.
Page 671
Chapter 18: Installation Configuring Terminals for Use with the Debugger...
To set the TERM environment variable for a color bit-mapped display top using the HP 98547A driver card: export TERM=300h To set the TERM environment variable for a HP 2392 terminal: export TERM=2392 To define and export the TERM environment variable for the VT220 terminal:...
To set up control sequences • Configure the stty settings in either /etc/profile or in $HOME/.profile. The control characters for most HP applications should be set as follows. If the control characters get changed, you can reset them by typing the commands shown below after you have logged in to the system.
Chapter 18: Installation Configuring Terminals for Use with the Debugger To resize a debugger window in an X-Window larger than 24 lines by 80 columns The following procedure describes how to resize a debugger window in an X-Windows larger than 24 lines by 80 columns. 1 Check to see that the L INES and COL UMNS shell environment variables are correctly set for the window that you are working in so that the debugger knows what the screen limits are.
Chapter 18: Installation Configuring Terminals for Use with the Debugger To resize a debugger window in a window larger than 24 lines by 80 columns The following procedure describes how to resize a debugger window in a windows larger than 24 lines by 80 columns. 1 Check to see that the stty settings for rows and columns are correct for the window that you are working in so that the debugger knows what the screen limits are.
Page 676
Chapter 18: Installation Configuring Terminals for Use with the Debugger You can edit the previous command to save some typing. Remember the following information when moving the status windows: The coordinates start from (0,0) in the upper left. The maximum width of the command line is 80. The top_row and bottom_row coordinates must be exactly three apart.
Page 677
Glossary absolute file An executable module generated by compiling, assembling, and linking a program. Absolute files must have an extension of .x. action key User-definable hotkeys that give you the ability to customize the interface. application default file A file containing default X resource specifications for an X Window System application.
Page 678
Glossary concurrent usage model Describes an interface in which the user can perform most comands at the same time that code is being executed under emulation. configuration file See “emulator configuration file”. cooked keyboard I/O mode The I/O mode in which keyboard input is processed.
Page 679
Glossary emulator configuration file A file that contains configuration settings and memory map definitions for the emulator. entry area A section of the command line area where commands are built. When you use menus or softkeys, the actual command which the debugger will execute appears in the entry area.
Page 680
Glossary PITS cycle Programming In The Small cycle. The repeating process of editing, compiling, and executing code to eliminate bugs. pointer The symbol on your computer’s screen which shows where the mouse is pointing. The pointer may be a hand, an arrow, or another shape. pop-up menu A menu that pops up when you press and hold the right mouse button.
Page 681
A software tool that simulates a microprocessor system for the purpose of debugging user programs. SPA The HP Software Performance Analyzer. standard interface The traditional debugger interface designed for use with several types of terminals, terminal emulators, and bitmapped displays. When using the standard interface, commands are entered from the keyboard.
Page 682
Glossary trigger The captured analyzer state about which other captured states are stored. The trigger state specifies when the trace measurement is taken. window A window inside the debugger’s display area. See also “X window”. working directory The current directory from which the debugger loads and saves files.
Page 683
141 displaying the alternate view of, 142 viewing information in, 143–144 active window, description of, 141 add bit-mapped displays to HP-UX, 638 add configured terminals to HP-UX, 638 add symbol, 130 adding an emulator, 632–633 Address for read cycles?, 304...
Page 684
392 analysis breakpoints, 105 analyzer configuring the clock, 323 ANSI keypad functions, 639 app-defaults directory HP 9000 computers, 336 Sun SPARCsystem computers, 336 append programs, 97 application default file, 653 application resource See X resource arguments for macros, 223...
Page 685
Index bit-mapped HP displays configuring, 641 set control sequences for, 649 blocks comparing, 216 copying, 215 filling, 216 Branch Validator, 126 break conditions, 295 break on access to a variable, 31, 48 Break processor on write to ROM?, 320 break_info macro, 558–559...
Page 686
Index button names, 9–11 byte macro, 560 bytes changing, 214 C operators, 523 C source code displaying, 146 C+ + breakpoints, 109–110, 362 browse command, 165, 466 classes, 466, 536 displaying class members, 162 displaying member values, 162 functions, 109–110, 146 inheritance, 466 object instance, 109 objects, 162...
Page 687
Index clear breakpoints, 111–112 click, 653 client, X, 270, 332 close macro, 561 cmd_forward macro, 562–563 code addresses, 533 code patching deleting C source lines from your program, 212–213 inserting lines of C code into your program, 212 patching a line, 211 color scheme, 272, 276, 339 column numbers, 532 Command (debugger status), 84...
Page 688
Index command lanugage (continued) floating point constants, 527 forming expressions, 536 global (extern) storage classes, 538 hexadecimal constants, 526 identical module names, 544 identifiers, 530 implicit stack references, 548 integer constants, 526 keywords, 535 legal characters allowed in symbols, 530 line numbers, 532 local storage classes, 539 macro local symbols, 531...
Page 689
Index command line (continued) editing entry area with keyboard, 81 editing entry area with pop-up menu, 77 editing entry area with pushbuttons, 76 entering commands, 75 entry area, 655 executing commands, 75 help, 78 how to display, 32 recalling commands with command line recall, 81 recalling commands with dialog box, 77 turning on or off, 74, 273 command line, description of, 79–83...
Page 690
176 control character functions list of, 58 using, 58 control program execution with breakpoints, 105–115 control sequences for HP terminals, setting up, 649 cooked mode, 654 coprocessor 68881, 149 coprocessor support, 149 copy block of memory, 215...
Page 691
Index copy window, 145 copy-and-paste addresses, 64 from entry buffer, 66 multi-window, 64, 67 symbol width, 64 to entry buffer, 63 CPU root pointer @CRP, 553 create a configuration file, 292 current working directory, displaying, 152 cursor control key functions, 143 cursor keys End (Shift_Home) Key Functions, 144 Home Key Functions, 144...
Page 693
265 display variable, 27 display variables in their declared type, 47 displaying pull-down menus with keyboard, 61 pull-down menus with mouse, 59–60 displaying functions, 18 displays bit-mapped, 639 configuring HP bit-mapped, 641 setting up HP bit-mapped, 649 do statement, 224...
Page 694
Index Do you want periodic read accesses while in background monitor?, 303 double-click, 654 dword macro, 564 E/A, 654 editing command line entry area with keyboard, 81 command line entry area with pop-up menu, 77 command line entry area with pushbuttons, 76 copying memory, 215 file, 208–209, 273 file at address, 209, 273...
Page 695
Index emulator/analyzer version requirement, 619 emulator/analyzer interface, 124 Enable signal interlocking on monitor accesses?, 306 enable simulated I/O, 174 enable the 68020 instruction cache?, 298 enable the 68030 instruction & data cache?, 298 Enable the DSack Interlock?, 306 End (Shift_Home) Key Functions, 144 end command, 314 end debugging session, 36, 51–52 enter commands from the keyboard, 79...
Page 696
Index error window, description of, 594 evaluating symbols, 547 Execute (debugger status), 84 executing UNIX commands from within the debugger, 123 execution run from current program counter address, 102 run from start address, 102 run until stop address, 103 execution (program), controlling, 100–104 exiting the debugger, 36 explicit stack references, 549 Expression C_Expression command, 399...
Page 698
105 halt program execution on instruction at a specified memory location, 107 hand pointer, 62 hardware HP 9000 memory needs, 620 HP 9000 minimum performance, 620 HP 9000 system requirements, 620 SPARCsystem memory needs, 624...
Page 699
Index iconify, 655 identifier, 530 if statement, 224 implicit stack references, 548 Include (debugger status), 84 increase simulated I/O file resources, 179–180 indicator characters, 85 initialized variables re-initializing, 217 InMon (debugger status), 84 Input (debugger status), 84 input scheme, 272, 339 insert lines of C code into your program, 212 install the emulator, 627 installation...
Page 700
535 L indicator character, 85 label scheme, 272, 276, 339 LANG environment variable, 339 level, stack, 115 libraries Motif for HP 9000/700, 620 line numbers, 532 lines in main display area, 274 literals radix, 252 load programs, 95–96 using the db68k command, 95...
Page 701
Index logging commands to command file, start, 238 commands to command file, stop, 240 macro, 655 Macro (debugger status), 85 macro arguments, 223 macro comments, 222 macro control flow statements do, 224 else, 224 if, 224 while, 224 macro limits maximum number of characters on a line, 222 maximum number of lines in a macro, 222 maximum number of parameters in a macro, 222...
Page 702
Index macros (continued) deleting, 236 dialog box, 225 displaying source code of, 235 do statement, 224 editing, 228 else statement, 224 example of ’when’, 359, 363–365 if statement, 224 loading, 229 maximum number of lines in a macro, 381 parameter checking, 255 patching C source with, 211–213 predefined, 555, 557–592 properties of, 221...
Page 703
310 Memory Display command, 437–438 Memory Management Unit, 120–121 memory map assigning terms, 308 memory recommendations HP 9000, 620 SPARCsystem, 624 Memory Register command, 439–440 Memory Unload_BBA command, 441–443 memset macro, 573 menu bar, 655...
Page 704
Monitor’s base address?, 305 monitor, to map 1:1 for use with MC68030 MMU, 326–328 more display, 259 More prompt, 144 Motif HP 9000/700 requirements, 620 mouse choosing menu items, 59–60 mouse button names, 9–11 move assembly-level status window, 264 move high-level status window, 263...
Page 707
Index processor block target system interrupts, 295 disable cache memory, 295 enable cache memory, 298 processor, resetting, 116 product version, displaying, 152 program commands, summary of, 356 Program Context Display command, 444 Program Context Expand command, 445 Program Context Set command, 446 program counter presetting, 317 program counter @PC, 553...
Page 708
Index protrams (continued) run until a specified stop address, 103 running, 100–104 step through, 100 pull-down menu, 656 pull-down menus choosing with keyboard, 61 choosing with mouse, 59–60 pushbutton, 656 quick start, 37, 39–52 graphical interface, 3–36 quitting the debugger, 36 R indicator character, 85 radix selecting, 252...
Page 709
Index reserved symbols (continued) stderr, 174 stdin, 173 stdout, 174 Reset map (change of monitor type requires map reset)?, 303 reset processor, 116 reset program counter, 116 reset program variables, 117 Reset value for Interrupt Stack Pointer?, 318 Reset value for Program Counter?, 318 reset vector reset stack pointer, 296 resize windows, 262...
Page 710
656 server, X, 270, 332, 658 session control commands, summary of, 353 set control sequences for HP bit-mapped displays, 649 set keyboard I/O mode, 175 set keyboard mode to cooked, 175 set keyboard mode to raw, 175...
Page 713
Index stdout reserved symbol, 174 step over functions, 27, 46, 101 step speed, setting, 253 step through a program, 100 stepping, 26, 46 sticky slider, 657 stop logging commands to command file, 240 stop a trace, 191 stop address, run from, 103 stopping the debugger, 36 storage classes automatic, 539...
Page 714
551–554 symbols,debugger, 130 symbols,program, 130 system requirements HP 9000 overview, 620 HP-UX minimum version, 620 OSF/Motif HP 9000/700 requirements, 620 SPARCsystem overview, 624 SunOS minimum version, 624 target program control of emulator interfaces, 562 target system disabling interrupts, 317...
Page 715
VT100, 643 configuring VT220, 645 RS-232, 638 set control sequences for the VT102, 649 set control sequences for vt220, 649 set up control sequences for HP, 649 supported, 637 TERM settings for, 638 token, 653 trace, 657 bus width, 392...
Page 716
Index Trace Halt command, 491 trace limitations when triggering on C variables, 188 trace limitations when triggering on instruction fetches, 189 trace measurement access breakpoints, 187 address and data values, 185 breakpoint interaction, 359 complex breakpoint, 202 default, 185 delete trace events, 194 disable storage qualifiers, 198 disable triggers, 198 display a trace, 192...
Page 723
This Hewlett-Packard system product is warranted against defects in materials and workmanship for a period of 90 days from date of installation. During the warranty period, HP will, at its option, either repair or replace products which prove to be defective.
Page 724
For products returned to HP for warranty service, Buyer shall prepay shipping charges to HP and HP shall pay shipping charges to return the product to Buyer. However, Buyer shall pay all shipping charges, duties, and taxes for products returned to HP from another country. HP warrants that its software and firmware designated by HP for use with an instrument will execute its programming instructions when properly installed on that instrument.