This file documents the gnu debugger gdb.
This is the Tenth Edition, of Debugging with gdb: the gnu Source-Level Debugger for gdb (GDB) Version 7.4.50.20120417.
Copyright © 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Sections being “Free Software” and “Free Software Needs Free Documentation”, with the Front-Cover Texts being “A GNU Manual,” and with the Back-Cover Texts as in (a) below.
(a) The FSF's Back-Cover Text is: “You are free to copy and modify this GNU Manual. Buying copies from GNU Press supports the FSF in developing GNU and promoting software freedom.”
Next: Summary, Previous: (dir), Up: (dir)
Debugging with gdb
This file describes gdb, the gnu symbolic debugger.
This is the Tenth Edition, for gdb (GDB) Version 7.4.50.20120417.
Copyright (C) 1988-2010 Free Software Foundation, Inc.
This edition of the GDB manual is dedicated to the memory of Fred Fish. Fred was a long-standing contributor to GDB and to Free software in general. We will miss him.
- Summary: Summary of gdb
- Sample Session: A sample gdb session
- Invocation: Getting in and out of gdb
- Commands: gdb commands
- Running: Running programs under gdb
- Stopping: Stopping and continuing
- Reverse Execution: Running programs backward
- Process Record and Replay: Recording inferior's execution and replaying it
- Stack: Examining the stack
- Source: Examining source files
- Data: Examining data
- Optimized Code: Debugging optimized code
- Macros: Preprocessor Macros
- Tracepoints: Debugging remote targets non-intrusively
- Overlays: Debugging programs that use overlays
- Languages: Using gdb with different languages
- Symbols: Examining the symbol table
- Altering: Altering execution
- GDB Files: gdb files
- Targets: Specifying a debugging target
- Remote Debugging: Debugging remote programs
- Configurations: Configuration-specific information
- Controlling GDB: Controlling gdb
- Extending GDB: Extending gdb
- Interpreters: Command Interpreters
- TUI: gdb Text User Interface
- Emacs: Using gdb under gnu Emacs
- GDB/MI: gdb's Machine Interface.
- Annotations: gdb's annotation interface.
- JIT Interface: Using the JIT debugging interface.
- In-Process Agent: In-Process Agent
- GDB Bugs: Reporting bugs in gdb
- Command Line Editing: Command Line Editing
- Using History Interactively: Using History Interactively
- In Memoriam: In Memoriam
- Formatting Documentation: How to format and print gdb documentation
- Installing GDB: Installing GDB
- Maintenance Commands: Maintenance Commands
- Remote Protocol: GDB Remote Serial Protocol
- Agent Expressions: The GDB Agent Expression Mechanism
- Target Descriptions: How targets can describe themselves to gdb
- Operating System Information: Getting additional information from the operating system
- Trace File Format: GDB trace file format
- Index Section Format: .gdb_index section format
- Copying: GNU General Public License says how you can copy and share GDB
- GNU Free Documentation License: The license for this documentation
- Index: Index
Table of Contents
- Debugging with gdb
- Summary of gdb
- 1 A Sample gdb Session
- 2 Getting In and Out of gdb
- 3 gdb Commands
- 4 Running Programs Under gdb
- 4.1 Compiling for Debugging
- 4.2 Starting your Program
- 4.3 Your Program's Arguments
- 4.4 Your Program's Environment
- 4.5 Your Program's Working Directory
- 4.6 Your Program's Input and Output
- 4.7 Debugging an Already-running Process
- 4.8 Killing the Child Process
- 4.9 Debugging Multiple Inferiors and Programs
- 4.10 Debugging Programs with Multiple Threads
- 4.11 Debugging Forks
- 4.12 Setting a Bookmark to Return to Later
- 5 Stopping and Continuing
- 6 Running programs backward
- 7 Recording Inferior's Execution and Replaying It
- 8 Examining the Stack
- 9 Examining Source Files
- 10 Examining Data
- 10.1 Expressions
- 10.2 Ambiguous Expressions
- 10.3 Program Variables
- 10.4 Artificial Arrays
- 10.5 Output Formats
- 10.6 Examining Memory
- 10.7 Automatic Display
- 10.8 Print Settings
- 10.9 Pretty Printing
- 10.10 Value History
- 10.11 Convenience Variables
- 10.12 Registers
- 10.13 Floating Point Hardware
- 10.14 Vector Unit
- 10.15 Operating System Auxiliary Information
- 10.16 Memory Region Attributes
- 10.17 Copy Between Memory and a File
- 10.18 How to Produce a Core File from Your Program
- 10.19 Character Sets
- 10.20 Caching Data of Remote Targets
- 10.21 Search Memory
- 11 Debugging Optimized Code
- 12 C Preprocessor Macros
- 13 Tracepoints
- 13.1 Commands to Set Tracepoints
- 13.1.1 Create and Delete Tracepoints
- 13.1.2 Enable and Disable Tracepoints
- 13.1.3 Tracepoint Passcounts
- 13.1.4 Tracepoint Conditions
- 13.1.5 Trace State Variables
- 13.1.6 Tracepoint Action Lists
- 13.1.7 Listing Tracepoints
- 13.1.8 Listing Static Tracepoint Markers
- 13.1.9 Starting and Stopping Trace Experiments
- 13.1.10 Tracepoint Restrictions
- 13.2 Using the Collected Data
- 13.3 Convenience Variables for Tracepoints
- 13.4 Using Trace Files
- 13.1 Commands to Set Tracepoints
- 14 Debugging Programs That Use Overlays
- 15 Using gdb with Different Languages
- 16 Examining the Symbol Table
- 17 Altering Execution
- 18 gdb Files
- 19 Specifying a Debugging Target
- 20 Debugging Remote Programs
- 21 Configuration-Specific Information
- 21.1 Native
- 21.2 Embedded Operating Systems
- 21.3 Embedded Processors
- 21.4 Architectures
- 22 Controlling gdb
- 23 Extending gdb
- 23.1 Canned Sequences of Commands
- 23.2 Scripting gdb using Python
- 23.2.1 Python Commands
- 23.2.2 Python API
- 23.2.2.1 Basic Python
- 23.2.2.2 Exception Handling
- 23.2.2.3 Values From Inferior
- 23.2.2.4 Types In Python
- 23.2.2.5 Pretty Printing API
- 23.2.2.6 Selecting Pretty-Printers
- 23.2.2.7 Writing a Pretty-Printer
- 23.2.2.8 Inferiors In Python
- 23.2.2.9 Events In Python
- 23.2.2.10 Threads In Python
- 23.2.2.11 Commands In Python
- 23.2.2.12 Parameters In Python
- 23.2.2.13 Writing new convenience functions
- 23.2.2.14 Program Spaces In Python
- 23.2.2.15 Objfiles In Python
- 23.2.2.16 Accessing inferior stack frames from Python.
- 23.2.2.17 Accessing frame blocks from Python.
- 23.2.2.18 Python representation of Symbols.
- 23.2.2.19 Symbol table representation in Python.
- 23.2.2.20 Manipulating breakpoints using Python
- 23.2.2.21 Finish Breakpoints
- 23.2.2.22 Python representation of lazy strings.
- 23.2.3 Auto-loading
- 23.2.4 Python modules
- 23.3 Creating new spellings of existing commands
- 24 Command Interpreters
- 25 gdb Text User Interface
- 26 Using gdb under gnu Emacs
- 27 The gdb/mi Interface
- Function and Purpose
- Notation and Terminology
- 27.1 gdb/mi General Design
- 27.2 gdb/mi Command Syntax
- 27.3 gdb/mi Compatibility with CLI
- 27.4 gdb/mi Development and Front Ends
- 27.5 gdb/mi Output Records
- 27.6 Simple Examples of gdb/mi Interaction
- 27.7 gdb/mi Command Description Format
- 27.8 gdb/mi Breakpoint Commands
- 27.9 gdb/mi Program Context
- 27.10 gdb/mi Thread Commands
- 27.11 gdb/mi Ada Tasking Commands
- 27.12 gdb/mi Program Execution
- 27.13 gdb/mi Stack Manipulation Commands
- 27.14 gdb/mi Variable Objects
- 27.15 gdb/mi Data Manipulation
- 27.16 gdb/mi Tracepoint Commands
- 27.17 gdb/mi Symbol Query Commands
- 27.18 gdb/mi File Commands
- 27.19 gdb/mi Target Manipulation Commands
- 27.20 gdb/mi File Transfer Commands
- 27.21 Miscellaneous gdb/mi Commands
- 28 gdb Annotations
- 29 JIT Compilation Interface
- 30 In-Process Agent
- 31 Reporting Bugs in gdb
- 32 Command Line Editing
- 33 Using History Interactively
- Appendix A In Memoriam
- Appendix B Formatting Documentation
- Appendix C Installing gdb
- Appendix D Maintenance Commands
- Appendix E gdb Remote Serial Protocol
- E.1 Overview
- E.2 Packets
- E.3 Stop Reply Packets
- E.4 General Query Packets
- E.5 Architecture-Specific Protocol Details
- E.6 Tracepoint Packets
- E.7 Host I/O Packets
- E.8 Interrupts
- E.9 Notification Packets
- E.10 Remote Protocol Support for Non-Stop Mode
- E.11 Packet Acknowledgment
- E.12 Examples
- E.13 File-I/O Remote Protocol Extension
- E.14 Library List Format
- E.15 Library List Format for SVR4 Targets
- E.16 Memory Map Format
- E.17 Thread List Format
- E.18 Traceframe Info Format
- Appendix F The GDB Agent Expression Mechanism
- Appendix G Target Descriptions
- Appendix H Operating System Information
- Appendix I Trace File Format
- Appendix J
.gdb_index
section format - Appendix K GNU GENERAL PUBLIC LICENSE
- Appendix L GNU Free Documentation License
- Index