HP (Hewlett-Packard) 5992-4701 manual
Summary of contents
- Debugging with GDB Manual
- Table of Contents
- Summary of GDB
- Free Software
- Contributors to GDB
- 1 A Sample GDB Session
- 1.1 Loading the Executable
- 1.2 Setting Display width
- 1.3 Setting Breakpoints
- 1.4 Running the executable under GDB
- 1.5 Stepping to the next line in the source program
- 1.6 Stepping into a subroutine
- 1.7 Examining the Stack
- 1.8 Printing Variable Values
- 1.9 Listing Source Code
- 1.10 Setting Variable Values During a Session
- 2 Getting In and Out of GDB
- 2.1 Invoking GDB
- 2.1.1 Choosing files
- 2.1.2 Choosing modes
- 2.1.3 Redirecting WDB input and output to a file
- 2.2 Quitting GDB
- 2.3 Shell commands
- 3 GDB Commands
- 3.1 Command syntax
- 3.2 Command completion
- 3.3 Getting help
- 4 Running Programs Under GDB
- 4.1 Compiling for debugging
- 4.2 Starting your program
- 4.3 Arguments To Your Program
- 4.4 Program Environment
- 4.5 Working directory
- 4.6 Program Input and Output
- 4.7 Debugging a Running Process
- 4.8 Killing the child process
- 4.9 Debugging programs with multiple threads
- 4.10 Debugging programs with multiple processes
- 5 Stopping and Continuing
- 5.1 Breakpoints
- 5.1.1 Setting breakpoints
- 5.1.2 Setting catchpoints
- 5.1.3 Deleting breakpoints
- 5.1.4 Disabling breakpoints
- 5.1.5 Break conditions
- 5.1.6 Breakpoint command lists
- 5.1.7 Breakpoint menus
- 5.1.8 “Cannot insert breakpoints”
- 5.2 Continuing and stepping
- 5.3 Signals
- 5.4 Stopping and starting multi-thread programs
- 6 Examining the Stack
- 6.1 Stack frames
- 6.2 Stacks Without frames
- 6.3 Commands for Examining the Stack
- 6.4 Backtraces
- 6.5 Selecting a frame
- 6.6 Information about a frame
- 7 Examining Source Files
- 7.1 Printing source lines
- 7.2 Searching source files
- 7.3 Specifying source directories
- 7.4 Source and machine code
- 8 Examining Data
- 8.1 Expressions
- 8.2 Program variables
- 8.3 Artificial arrays
- 8.4 Output formats
- 8.5 Examining memory
- 8.6 Automatic display
- 8.7 Print settings
- 8.8 Value history
- 8.9 Convenience variables
- 8.10 Registers
- 8.11 Printing Floating Point Values
- 8.12 Floating point hardware
- 9 Using GDB with Different Languages
- 9.1 Switching between source languages
- 9.1.1 List of filename extensions and languages
- 9.1.2 Setting the working language
- 9.1.3 Having GDB infer the source language
- 9.2 Displaying the language
- 9.3 Type and range checking
- 9.3.1 An overview of type checking
- 9.3.2 An overview of range checking
- 9.4 Supported languages
- 9.4.1 C and C++
- 9.4.1.1 C and C++ operators
- 9.4.1.2 C and C++ constants
- 9.4.1.3 C++ expressions
- 9.4.1.4 C and C++ defaults
- 9.4.1.5 C and C++ type and range checks
- 9.4.1.6 GDB and C
- 9.4.1.7 GDB features for C++
- 9.4.2 Fortran
- 9.4.2.1 Fortran types
- 9.4.2.2 Fortran operators
- 9.4.2.3 Fortran special issues
- 10 Examining the Symbol Table
- 11 Altering Execution
- 11.1 Assignment to variables
- 11.2 Continuing at a different address
- 11.3 Giving your program a signal
- 11.4 Returning from a function
- 11.5 Calling program functions
- 11.6 Patching programs
- 12 GDB Files
- 12.1 Commands to specify files
- 12.2 Specifying shared library locations
- 12.3 Errors reading symbol files
- 13 Specifying a Debugging Target
- 13.1 Active targets
- 13.2 Commands for managing targets
- 13.3 Choosing target byte order
- 14 HP-UX Configuration-Specific Information
- 14.1 Summary of HP Enhancements to GDB
- 14.2 HP-UX dependencies
- 14.2.1 Linker Dependencies
- 14.2.2 Dependent Standard Library Routines for Run Time Checking
- 14.3 Supported Platforms and Modes
- 14.4 HP-UX targets
- 14.5 Support for Alternate root
- 14.6 Specifying object file directories
- 14.7 Fix and continue debugging
- 14.7.1 Fix and Continue compiler dependencies
- 14.7.2 Fix and Continue restrictions
- 14.7.3 Using Fix and Continue
- 14.7.4 Example Fix and Continue session
- 14.8 Inline Support
- 14.8.1 Inline Debugging in HP 9000 Systems
- 14.8.2 Inline Debugging in Integrity Systems
- 14.8.2.1 Debugging Inline Functions in Integrity Systems
- 14.9 Debugging Macros
- 14.9.1 Viewing and Evaluating Macro Definitions
- 14.9.1.1 Compiler Options to Enable Macro Debugging
- 14.9.2 Examples for Macro Debugging
- 14.10 Debugging Memory Problems
- 14.10.1 When to suspect a memory leak
- 14.10.2 Memory debugging restrictions
- 14.10.3 Memory Debugging Methodologies
- 14.10.4 Debugging Memory in Interactive Mode
- 14.10.4.1 Commands for interactive memory debugging
- 14.10.4.2 Example for interactive debugging session
- 14.10.5 Debugging Memory in Batch Mode
- 14.10.5.1 Setting Configuration Options for Batch Mode
- 14.10.5.2 Environment variable setting for Batch mode debugging
- 14.10.5.3 Example for Batch Mode RTC
- 14.10.6 Debugging Memory Interactively After Attaching to a Running Process
- 14.10.7 Configuring memory debugging settings
- 14.10.7.1 Specifying the stack depth
- 14.10.7.2 Specifying minimum leak size
- 14.10.7.3 Specifying minimum block size
- 14.10.8 Scenarios in memory debugging
- 14.10.8.1 Stop when freeing unallocated or deallocated blocks
- 14.10.8.2 Stop when freeing a block if bad writes occurred outside block boundary
- 14.10.8.3 Stop when a specified block address is allocated or deallocated
- 14.10.8.4 Scramble previous memory contents at malloc/free calls
- 14.10.8.5 Detect dangling pointers and dangling blocks
- 14.10.8.6 Detect in-block corruption of freed blocks
- 14.10.8.7 Specify the amount of guard bytes for every block of allocated memory
- 14.10.9 Comparison of Memory Debugging Commands in Interactive Mode and Batch Mode
- 14.10.10 Heap Profiling
- 14.10.10.1 Commands for heap profiling
- 14.10.10.2 info heap arena
- 14.10.10.3 info heap arena [0 |1|2|..] blocks stacks
- 14.10.10.4 info module ADDRESS
- 14.10.10.5 info heap process
- 14.10.10.6 Example for heap profiling
- 14.10.11 Memory Checking Analysis for User Defined Memory Management Routines
- 14.10.12 Commands to track the change in data segment value
- 14.11 Thread Debugging Support
- 14.11.1 Support for Enabling and Disabling Specific Threads
- 14.11.2 Backtrace Support for Thread Debugging
- 14.11.3 Advanced Thread Debugging Support
- 14.11.3.1 Pre-requisites for Advanced Thread Debugging
- 14.11.3.2 Enabling and Disabling Advanced Thread Debugging Features
- 14.11.3.3 Commands to view information on pthread primitives
- 14.11.4 Debugging Threads Interactively After Attaching to a Process
- 14.11.5 Thread Debugging in Batch Mode
- 14.11.5.1 Pre-requisites for Batch mode of Thread Debugging
- 14.11.5.2 Limitations in Batch mode of thread debugging
- 14.11.6 Thread Debugging in +check Mode
- 14.11.7 Known issues with Thread Debugging for Interactive and Batch mode
- 14.12 Debugging MPI Programs
- 14.13 Debugging multiple processes ( programs with fork and vfork calls)
- 14.13.1 Ask mode for set follow-fork-mode
- 14.13.2 Serial mode for set follow-fork-mode
- 14.13.3 Support for showing unwind info
- 14.13.4 Printing CFM and PFS registers
- 14.14 Command to Search for a Pattern in the Memory Address Space
- 14.15 Debugging Core Files
- 14.15.1 Generating core files with packcore /unpackcore/getcore
- 14.15.2 Support for the info target Command
- 14.15.3 Support for the dumpcore command
- 14.15.3.1 Enhancements to the dumpcore command
- 14.15.4 Support for display of run time type information
- 14.16 Printing the Execution Path Entries for the Current Frame or Thread
- 14.16.1 Compiler Dependencies for Printing the Execution Path Entries
- 14.16.2 Example Illustrating Execution Path Recovery
- 14.17 Command to Unwind Beyond 10000 Frames
- 14.18 Invoking GDB Before a Program Aborts
- 14.19 Aborting a Command Line Call
- 14.20 Instruction Level Stepping
- 14.21 Enhanced support for watchpoints and breakpoints
- 14.21.1 Deferred watchpoints
- 14.21.2 Hardware watchpoints
- 14.21.3 Hardware breakpoints
- 14.21.3.1 Setting breakpoints in unstripped shared library
- 14.21.4 Support for procedural breakpoints
- 14.21.5 Support for template breakpoints
- 14.22 Debugging support for shared libraries
- 14.22.1 Using shared library as main program
- 14.22.2 Setting Deferred Breakpoints in Shared Library
- 14.22.3 Using catch load
- 14.22.4 Privately mapping shared libraries
- 14.22.5 Selectively Mapping Shared Libraries As Private
- 14.22.6 Setting breakpoints in shared library
- 14.22.7 Enhancement to the info shared Command
- 14.23 Debugging support for Decimal Floating Point data type
- 14.23.1 Printing Decimal Floating point data types
- 14.23.1.1 Printing Decimal floating point constant
- 14.23.1.2 Printing Decimal floating point variable
- 14.23.2 Printing NaT Registers
- 14.23.3 Handling Decimal Floating Point Data types
- 14.23.4 Evaluating Decimal Floating Point data types
- 14.23.4.1 Printing type of Decimal Floating Point variable
- 14.24 Additional Support for binary floating point data type
- 14.24.1 Support for Binary Floating Point constants f, l
- 14.24.2 Support Binary Floating Point variables with format specifier
- 14.25 Language support
- 14.25.1 Enhanced Java Debugging Support
- 14.25.1.1 Java Stack Unwind Features
- 14.25.1.2 gdb Subcommands for Java VM Debugging
- 14.25.1.3 Java corefile debugging support
- 14.25.1.4 Java attach mode debugging support
- 14.25.2 Enhanced support for C++ templates
- 14.25.3 Support for _ _fpreg data type on IPF
- 14.25.4 Support for _Complex variables in HP C
- 14.25.5 Support for debugging namespaces
- 14.25.6 Command for evaluating the address of an expression
- 14.26 Viewing Wide Character Strings
- 14.27 Support for output logging
- 14.27.1 Support for dumping array in an ASCII file
- 14.27.2 Support for Fortran array slices
- 14.27.3 Displaying enumerators
- 14.27.4 Support for debugging typedefs
- 14.27.5 Support for steplast command for C and C++
- 14.28 Getting information from a non-debug executable
- 14.29 Debugging optimized code
- 14.29.1 Debugging Optimized Code at Various Optimization Levels
- 14.29.1.1 +O0 and +O1
- 14.29.1.2 +O2/+O3/+O4/-ipo
- 14.30 Debugging with ARIES
- 14.30.1 Debugging the application using GDB under ARIES
- 14.30.1.1 Limitations of GDB Support under ARIES
- 14.30.2 Attaching GDB to an already running emulated process
- 14.30.3 Detecting memory leaks using GDB under ARIES
- 14.31 Visual Interface for WDB
- 14.31.1 Starting and stopping Visual Interface for WDB
- 14.31.2 Navigating the Visual Interface for WDB display
- 14.31.3 Specifying foreground and background colors
- 14.31.4 Using the X-window graphical interface
- 14.31.5 Using the TUI mode
- 14.31.6 Changing the size of the source or debugger pane
- 14.31.7 Using commands to browse through source files
- 14.31.8 Loading source files
- 14.31.9 Editing source files
- 14.31.10 Editing the command line and command-line history
- 14.31.11 Saving the contents of a debugging session to a file
- 14.32 Support for ddd
- 14.33 Support for XDB commands
- 14.33.1 stop in/at dbx commands
- 14.34 GNU GDB Logging Commands
- 14.35 Support for command line calls in a stripped executable
- 14.35.1 Support for command line calls in a stripped executable on PA-RISC systems
- 14.35.2 Additional support for command line calls in a stripped executable
- 14.35.2.1 For 32-bit applications:
- 14.35.2.2 For 64-bit applications
- 14.35.3 Support for debugging stripped binaries
- 14.35.3.1 Printing of locals and globals in a stripped module
- 14.35.3.2 Backtrace on stripped frames
- 14.35.3.3 Command line calls to non-stripped library
- 14.35.3.4 Setting breakpoints in unstripped shared library
- 14.36 Displaying the current block scope information
- 14.37 Linux support
- 15 The HP-UX Terminal User Interface
- 15.1 Starting the TUI
- 15.2 Automatically running a program at startup
- 15.3 Screen Layouts
- 15.3.1 Source pane
- 15.3.2 Disassembly pane
- 15.3.3 Source/Disassembly pane
- 15.3.4 Disassembly/Register pane
- 15.3.5 Source/Register pane
- 15.4 Cycling through the panes
- 15.5 Changing pane focus
- 15.6 Scrolling panes
- 15.7 Changing the register display
- 15.8 Changing the pane size
- 15.9 Refreshing and updating the window
- 16 XDB to WDB Transition Guide
- 16.1 By-function lists of XDB commands and HP WDB equivalents
- 16.1.1 Invocation commands
- 16.1.2 Window mode commands
- 16.1.3 File viewing commands
- 16.1.4 Source directory mapping commands
- 16.1.5 Data Viewing and modification commands
- 16.1.6 Stack viewing commands
- 16.1.7 Status-viewing command
- 16.1.8 Job control commands
- 16.2 Overall breakpoint commands
- 16.2.1 Auxiliary breakpoint commands
- 16.2.2 Breakpoint creation commands
- 16.2.3 Breakpoint status commands
- 16.2.4 All-procedures breakpoint commands
- 16.2.5 Global breakpoint commands
- 16.2.6 Assertion control commands
- 16.2.7 Record and playback commands
- 16.2.8 Macro facility commands
- 16.2.9 Signal control commands
- 16.2.10 Miscellaneous commands
- 16.3 XDB data formats and HP WDB equivalents
- 16.4 XDB location syntax and HP WDB equivalents
- 16.5 XDB special language operators and HP WDB equivalents
- 16.6 XDB special variables and HP WDB equivalents
- 16.7 XDB variable identifiers and HP WDB equivalents
- 16.8 Alphabetical lists of XDB commands and HP WDB equivalents
- 16.8.1 A
- 16.8.2 B
- 16.8.3 C through D
- 16.8.4 F through K
- 16.8.5 L
- 16.8.6 M through P
- 16.8.7 Q through S
- 16.8.8 T
- 16.8.9 U through Z
- 16.8.10 Symbols
- 17 Controlling GDB
- 17.1 Setting the GDB Prompt
- 17.2 Setting Command Editing Options in GDB
- 17.3 Setting Command History Feature in GDB
- 17.4 Setting the GDB Screen Size
- 17.5 Supported Number Formats
- 17.6 Optional warnings and messages
- 17.7 Optional messages about internal happenings
- 18 Canned Sequences of Commands
- 18.1 User-defined commands
- 18.2 User-defined command hooks
- 18.3 Command files
- 18.4 Commands for controlled output
- 19 Using GDB under gnu Emacs
- 20 GDB Annotations
- 20.1 What is an annotation?
- 20.2 The server prefix
- 20.3 Values
- 20.4 Frames
- 20.5 Displays
- 20.6 Annotation for GDB input
- 20.7 Errors
- 20.8 Information on breakpoints
- 20.9 Invalidation notices
- 20.10 Running the program
- 20.11 Displaying source
- 20.12 Annotations We Might Want in the Future
- 21 The GDB/MI Interface
- 21.1 GDB/MI Command Syntax
- 21.1.1 GDB/MI Input syntax
- 21.1.2 GDB/MI Output syntax
- 21.1.3 Simple examples of GDB/MI interaction
- 21.2 GDB/MI compatibility with CLI
- 21.3 GDB/MI output records
- 21.3.1 GDB/MI result records
- 21.3.2 GDB/MI stream records
- 21.3.3 GDB/MI out-of-band records
- 21.4 GDB/MI command description format
- 21.5 GDB/MI breakpoint table commands
- 21.6 GDB/MI Data manipulation
- 21.7 GDB/MI program control
- 21.8 Miscellaneous GDB commands in GDB/MI
- 21.9 GDB/MI Stack Manipulation Commands
- 21.10 GDB/MI Symbol query commands
- 21.11 GDB/MI Target Manipulation Commands
- 21.12 GDB/MI thread commands
- 21.13 GDB/MI tracepoint commands
- 21.14 GDB/MI variable objects
- 22 Reporting Bugs in GDB
- 22.1 Have you found a bug?
- 22.2 How to report bugs
- A Installing GDB
- A.1 Compiling GDB in another directory
- A.2 Specifying names for hosts and targets
- A.3 configure options