Product SiteDocumentation Site

Chapter 5. Debugging

5.1. Installing Debuginfo Packages
5.2. GDB
5.2.1. Simple GDB
5.2.2. Running GDB
5.2.3. Conditional Breakpoints
5.2.4. Forked Execution
5.2.5. Threads
5.2.6. GDB Variations and Environments
5.2.7. GDB Documentation
5.3. Variable Tracking at Assignments
5.4. Python Pretty-Printers
Useful, well-written software generally goes through different phases of application development, and mistakes can occur in each phase. Some phases come with their own set of mechanisms to detect certain mistakes; during compilation, for example, most compilers perform elementary semantic analysis, making sure objects such as variables and functions are adequately described.
The error-checking mechanisms of each application development phase helps catch simple and obvious mistakes in code. The debugging phase helps catch more subtle errors; ones that fell through the cracks during routine code inspection.

5.1. Installing Debuginfo Packages

Red Hat Enterprise Linux also provides -debuginfo packages for all architecture-dependent RPMs included in the operating system. A -debuginfo package contains accurate debugging information for its corresponding package. To install the -debuginfo package of a package (i.e. typically packagename-debuginfo), use the following command:
debuginfo-install packagename

Note

Attempting to debug a package without having its -debuginfo equivalent installed may fail, although GDB will try to provide any helpful diagnostics it can.