
gdb
Overview
GNU Command Line Debugger
Usage Guide
gdb runs in a terminal window, either launching a process to be debugged or attaching to a running process. To launch a process in the debugger, run:
gdb
To attach to a running process, run:
gdb - < PID> (eg gdb - 4563)
The debugger will load symbols when run and display the (gdb) prompt. A few handy debugger commands are info, backtrace and bt full. backtrace and bt full will display the functions on the stack. The info commands display a range of information. Some examples are:
info checkpoints ID's of forks and checkpoints.
info files List of targets and files being debugged.
info functions List of all function names.
info frame
info mem Memory, pointers, variable locations, etc.
info sources Lists program source files.
info threads Lists ID's of threads.
info variables Lists all global and static variable names.
Tool Data
Operating Platform: | Linux |
Diagnostic Target: | OS - Debugging |
Tool Executable: | gdb |
Obtain From: | gnu.org and most package managers, eg Debian apt and Redhat RPM |