Debugging with GDB

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

Copyright © 1988-2020 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   [Contents][Index]

Debugging with GDB

This file describes GDB, the GNU symbolic debugger.

This is the Tenth Edition, for GDB (GDB) Version

Copyright (C) 1988-2020 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 of GDB

Sample Session:


A sample GDB session



Getting in and out of GDB



GDB commands



Running programs under GDB



Stopping and continuing

Reverse Execution:


Running programs backward

Process Record and Replay:


Recording inferior’s execution and replaying it



Examining the stack



Examining source files



Examining data

Optimized Code:


Debugging optimized code



Preprocessor Macros



Debugging remote targets non-intrusively



Debugging programs that use overlays



Using GDB with different languages



Examining the symbol table



Altering execution

GDB Files:


GDB files



Specifying a debugging target

Remote Debugging:


Debugging remote programs



Configuration-specific information

Controlling GDB:


Controlling GDB

Extending GDB:


Extending GDB



Command Interpreters



GDB Text User Interface



Using GDB under GNU Emacs



GDB’s Machine Interface.



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

Man Pages:


Manual pages



GNU General Public License says how you can copy and share GDB

GNU Free Documentation License:


The license for this documentation

Concept Index:


Index of GDB concepts

Command and Variable Index:


Index of GDB commands, variables, functions, and Python data types

Table of Contents

Next: Summary   [Contents][Index]