title: Debugging with GDB: The GNU source-level debugger (GNU manuals)
author: Richard Stallman
description: The GNU Debugger allows you to see what is going on "inside" a program while it executes - or what a program was doing at the moment it crashed.
  
  GDB supports C, C++, Java, Fortran and Assembly among other languages; it is also designed to work closely with the GNU Compiler Collection (GCC).
  
  The GNU Debugger Program has four special features that helps you catch bugs in the act:
  
  It starts your program for you, specifying anything that might affect it's behavior.
  Makes your program stop under specified conditions.
  Examines what happened when the program stopped.
  Allows you to experiment with changes to see what effect they have on the program.
  This book will show you:
  
  setting and clearing breakpoints
  examining the stack, source files and data
  examining the symbol table
  altering program execution
  specifying a target for debugging
  how to control the debugger
  how to use canned command sequences
  how to install GDB
  and much more!
  This manual is written for programmers. It is designed so someone can begin utilizing GDB after just reading the first chapter, or read the whole manual and master the program. Synopsis of ideas and extensive examples are given.
zlib_text: Debugging with gdb
  The gnu Source-Level Debugger
  Tenth Edition, for gdb version 8.3.1
  (GDB)
  Richard Stallman, Roland Pesch, Stan Shebs, et al.
  
  (Send bugs and comments on gdb to http://www.gnu.org/software/gdb/bugs/.)
  Debugging with gdb
  TEXinfo 2019-09-20.22
  Published by the Free Software Foundation
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  ISBN 978-0-9831592-3-0
  Copyright c⃝ 1988-2019 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 Man-
  ual. Buying copies from GNU Press supports the FSF in developing GNU and promoting
  softw