Computer ScienceScience & MathematicsEconomics & FinanceBusiness & ManagementPolitics & GovernmentHistoryPhilosophy

Debugging with GDB

The GNU Source-Level Debugger

by Richard Stallman, Roland Pesch, Stan Shebs

Debugging with GDB

Subscribe to new books via telegram channel

DescriptionTable of ContentsDetailsHashtagsReport an issue

Book 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.

The purpose of a debugger such as gdb is to allow you to see what is going on "inside" another program while it executes - or what another program was doing at the moment it crashed. gdb can do four main kinds of things (plus other things in support of these) to help you catch bugs in the act:
- Start your program, specifying anything that might affect its behavior;
- Make your program stop on specified conditions;
- Examine what has happened, when your program has stopped;
- Change things in your program, so you can experiment with correcting the effects of one bug and go on to learn about another.

This open book is licensed under a GNU Free Documentation License (GNU FDL). You can download Debugging with GDB ebook for free in PDF format (4.5 MB).

Table of Contents

Chapter 1
A Sample GDB Session
Chapter 2
Getting In and Out of GDB
Chapter 3
GDB Commands
Chapter 4
Running Programs Under GDB
Chapter 5
Stopping and Continuing
Chapter 6
Running programs backward
Chapter 7
Recording Inferior's Execution and Replaying It
Chapter 8
Examining the Stack
Chapter 9
Examining Source Files
Chapter 10
Examining Data
Chapter 11
Debugging Optimized Code
Chapter 12
Debugging on Intel(R) Architecture
Chapter 13
C Preprocessor Macros
Chapter 14
Chapter 15
Debugging Programs That Use Overlays
Chapter 16
Using GDB with Different Languages
Chapter 17
Examining the Symbol Table
Chapter 18
Altering Execution
Chapter 19
GDB Files
Chapter 20
Specifying a Debugging Target
Chapter 21
Debugging Remote Programs
Chapter 22
Configuration-Specific Information
Chapter 23
Controlling GDB
Chapter 24
Extending GDB
Chapter 25
Command Interpreters
Chapter 26
GDB Text User Interface
Chapter 27
Using GDB under gnu Emacs
Chapter 28
The GDB/Mi Interface
Chapter 29
GDB Annotations
Chapter 30
JIT Compilation Interface
Chapter 31
In-Process Agent
Chapter 32
Reporting Bugs in GDB
Chapter 33
Command Line Editing
Chapter 34
Using History Interactively

Book Details

Debugging with GDB
Computer Science
ISBN13 Digital
ISBN10 Digital
PDF Size
4.5 MB

Related Books

Operating Systems: From 0 to 1
This book helps you gain the foundational knowledge required to write an operating system from scratch. Hence the title, 0 to 1. After completing this book, at the very least you will learn: - How to write an operating system from scratch by reading hardware datasheets. In the real world, it works like that. You won't be able to consult Go...
WPF Debugging and Performance Succinctly
WPF allows you to build modern desktop applications for Windows, and part of building an application is debugging code and optimizing performance. In Alessandro Del Sole's WPF Debugging and Performance Succinctly, you will learn how to debug a WPF application by leveraging all the powerful tools in Visual Studio, including the most recent addi...
Test-Driven Development with Python
By taking you through the development of a real web application from beginning to end, this hands-on guide demonstrates the practical advantages of test-driven development (TDD) with Python. You'll learn how to write and run tests before building each part of your app, and then develop the minimum amount of code required to pass those tests. T...
Guide to NoSQL with Azure Cosmos DB
Cosmos DB is a NoSQL database service included in Azure that is continuously adding new features and has quickly become one of the most innovative services found in Azure, targeting mission-critical applications at a global scale. This book starts off by showing you the main features of Cosmos DB, their supported NoSQL data models and the foundatio...
Android on x86
Android on x86: an Introduction to Optimizing for IntelĀ® Architecture serves two main purposes. First, it makes the case for adapting your applications onto Intel's x86 architecture, including discussions of the business potential, the changing landscape of the Android marketplace, and the unique challenges and opportunities that arise from x...
Think Python
If you want to learn how to program, working with Python is an excellent way to start. This hands-on guide takes you through the language a step at a time, beginning with basic programming concepts before moving on to functions, recursion, data structures, and object-oriented design. This second edition and its supporting code have been updated for...