HP 9000 Series 700/800 Computers
Legal Notices
c Copyright 1980, 1984, 1986 Novell, Inc
c Copyright 1986-1992Sun Microsystems, Inc
c Copyright 1990 Motorola, Inc
X Window System is a trademark of the Massachusetts Institute of Technology
Printing History
Preface
Page
Page
Related Documentation
For more information on HP-UXprogramming, refer to the following documents:
(B3476-90016)
(B3906-90002)
(B3906-90001)
(B2355-90044)
describes the
xdb debugger
Page
Page
Page
Contents
Page
Page
Page
Page
Figures
Tables
Page
Overview
HP/DDE at a Glance
Page
Shows source le line numbers
An arrow indicates the current program counter location
To search for text strings in the source le, select Visit:Search
You can change these buttons or create additional buttons by selecting
Enter debugger commands
Page
HP/DDE Online Help
Page
Page
Compiling, Loading, and Executing the Target Program
Preparing the Target Program
Invoking the Debugger
Invoking and Loading a Target Program During Debugger Startup
Invoking and Loading a Target Program From the Debugger
Page
Attaching the Debugger to a Running Process
Page
Stopping the Target Program
Restarting the Target Program
Interrupting a Running Program
Page
Examining Source Files
. Select
or use the
command to put the source le in the debugger's search path
However, you can view debuggable modules by selecting
or using the
Executing the Target Program
ere
You can modify the default behavior of these buttons by selecting
. The
Using the go Command
The go command begins or resumes target program execution
Using the step Command
By default, the
to invoke it
Page
Looking at the Call/Return Stack
Page
Page
Using Monitors (Breakpoints, Watchpoints
Traces, and Intercepts)
Using Monitors
Setting Breakpoints
Page
Page
Page
Page
Setting Watchpoints
Page
Individual elements in a watchpoint (suc
h as som
e elements in an array) can be hidden by selecting them and selecting
to redisplay them
clicking
Page
Page
2. Select the granularity (how often the value is checked)
The default, Every Stop , causes the debugger to check values only when
target program
execution
event like a breakpoint
Setting Traces
Page
Page
Page
Setting Intercepts
Page
Page
Viewing and Manipulating Target Program Data
Examining Variables and Expressions
Page
Using the Data Value Menu
As shown in Figure
4-1
a number of
commands are available from the
Page
To specify a limit on the number of elements the
command displays, use the
command. For example
sets the limit at
In languages that support special interpretation of pointers to characters:
Instead of using language-specic syntax, you can use the -indirect option to
the print command as follows:
Follow all pointers encountered and show the value of
the object pointed to
Follow pointers no further than count levels
command assigns the value of
to the pointer
command then executes the commands b etween the brackets as long as
. All output is redirected to the le
Use the describe , print, and dump commands to examine buers
See the online command reference for more information on the
commands
Examining Registers
Page
Page
Using Debugger Commands
Abbreviating Debugger Commands
Entering Multiple Debugger Commands on One Line
Using Command Lists
Continuing Commands on the Next Line
Resolving Syntax Conflicts
Resolving Case Sensitivity
Editing the Command Line
Using the Command History Facility
Recording Command Sequences for Later Playback
Invoking Shell Commands from the Debugger
Redirecting Input and Output
Page
Creating Alias and Define Macros
Page
Using Reserved Identifiers and Special Macros
Page
Page
Page
Combining Debugger Commands Using Action Lists
Creating Conditional Action Lists
Use the if command to create conditional action lists. For example, the command
You can also add a
command
Page
Page
Customizing the Debugger
Using the Options Menu
Using Startup Command Files
Using a Personal Startup File to Customize the Debugger
A personal startup le typically contains commands that:
Page
Page
Page
Emulating Other Debuggers
Be aware that the macros aect the input syntax of commands but have no
Compatibility with dbx
denes macros that let you enter
commands without prexes. For example, you can specify
rather than
Page
Identifying Program Objects
Understanding Blocks and Environments
Page
Applying Scope and Visibility Rules
Page
Using Qualified Names
Page
Page
Image Qualified Names
where `image(average) contains average , to name the procedure sum
Special Block Qualified Forms
See Appendix B and Appendix D for information on the v alid values for
Page
Page
Page
Debugging in Special Situations
Examining Core Files
Core File Debugging
Debugging Shared Libraries
Page
Debugging Multi-ThreadedApplications
Page
Viewing and Manipulating Threads
Notice the following in the thread list:
You can use these numeric identiers for commands that require a
(for example
Page
Environment in Multi-ThreadedApplications
Notice the output indicates that the current environment is in Thread
Thread-SpecificDebugger Commands
The two commands that apply specically to debugging threaded applications
are
Page
Assembly Level Debugging
Page
Page
machine address
You can also use the describe command with the `va function. For example:
Saving Assembly Code in a File
You can determine address values from the Assembly Display window
Debugging Optimized Code
Optimized Code and Unoptimized Code
In eect, optimization transforms a program into a dierent program
The following sections describe these problems in detail
Page
Page
Page
Debugging Parent and Child Processes
Debugging Applications That Use ioctl or curses
Running the Debugger Remotely
Line-ModeUser Interface
Invoking the Line-ModeUser Interface
The User Interface Startup File
Screen Display Conventions
Examples
Single step one statement using the predened alias s
Use the predened alias up to walk up the stack
Page
Language Managers
Page
C Language Manager
Page
Integer
l j U j u] (decimal)
] (hexadecimal)
] (octal)
For example, 0xFu species an unsigned hexadecimal
Array slices
None
The type of identier ; can be used to refer to anonymous types
In place of an array subscript, you can give a range of elements:
Lower bound to upper
C++ Language Manager
Page
The following are also available with the HP ANSI CC compiler:
Scope resolution
The following operators are available with the HP ANSI CC compiler:
Dynamic cast
Type identication
] (decimal)
Name
visible from the scope
Virtual address
Page
FORTRAN Language Manager
Declaration
digits (decimal)
KS ](radix = 2, 8, 10, 16; KS = 1, 2, 4, 8)
For example, 16#1c6 species a hexadecimal integer
Real
= 4,8,16)
visible from the scope location
Cast the resulting value of expression
of elements:
Given expr to upper
bound, stride of
Lower bound to expr2
stride of expr3
Given expr1 to upper
bound, stride of expr3
HP Pascal Language Manager
=, <>, <, >, <=, >=, in
Boolean
Set
Field selection
Dereference
For example, 5.48E-11 is a valid real number
Pointer
upper bound Example:
HP-UX PA-RISCAssembly Language Manager
Page
Mod
&, |, ^, ~ (and, or, xor, not)
Name from source program
Register direct
Indirect
Solaris SPARC Assembly Language Manager
Page
8 bits as a char
bits
Page
Target Managers
by creating a link to the target type name in the
directory /opt/langtools/dde/tgt . For example
to make hppa a valid target type, enter the following
debugger loads the manager
HP-UX PA-RISCTarget Manager
Page
Page
One of the following arguments to the command target command :
dump proc [full] Prints a list of known target processes
helpLists and describes the supported target commands
The startup le
denes the following macros:
Solaris SPARC Target Manager
A program invocation of the form program path [program arguments ]
A UNIX signal number (integer) or one of the following UNIX signal names:
Dumps registers
Dumps single-precision oating-point registers
Page
Page
Object Managers
Page
HP SOM Object Manager
Solaris SPARC Object Manager
User Interface Managers
Page
Graphical User Interface Manager
Line-ModeUser Interface Manager
SoftBench User Interface Manager
Page
Glossary
. A block qualied name explicitly iden ties the
enclosing the object and the object's name; the format is
Page
Page
Outer debugger
used to contain denitions of
user-declared
symbol names. You may explicitly refer to symbol names created using the
command by using a
A shared library that is loaded by a call within your program to
shl load (3X) (on HP-UXsystems) or dlopen(3X) (on Solaris systems)
and block enclosing the object and the object's name; the format is
A loaded executable le or shared library
. An image qualied name explicitly identies the image, module, and
A shared library that is linked against your program
A text area that can accept t yped keystrokes
maps a statement to the instruction at which some data value may change. The
The window that contains the main
, the \( ):
, the
, the \Debugger Input:
A software \trigger," such as a breakpoint, that interrupts
A specication of the replacement of a previous path argument to the
property sdir command by a new path argument. The new path
argument replaces the old one as a directory prex in the source le
directory search path
. See
The region of source code over which a name's declaration is active
Page
The program that is currently being debugged
Page
Page
Index