Group Listing of GDB Commands

This section summarizes the GDB commands by task. Esoteric commands, such as those used by GDB’s maintainers, or to cross-debug remote systems connected via serial port or a network, have been omitted.

Aliases for Other Commands

Alias

Short for ...

Alias

Short for ...

bt

backtrace

i

info

c

continue

l

list

cont

continue

n

next

d

delete

ni

nexti

dir

directory

p

print

dis

disable

po

print-object

do

down

r

run

e

edit

s

step

f

frame

share

sharedlibrary

fo

forward-search

si

stepi

gcore

generate-core-file

u

until

h

help

where

backtrace

Breakpoints

awatch

Set an expression watchpoint.

break

Set a breakpoint at a line or function.

catch

Set a catchpoint to catch an event.

clear

Clear a given breakpoint.

commands

Specify commands to run when a breakpoint is reached.

condition

Supply a condition to a particular breakpoint.

delete

Delete one or more breakpoints or auto-display expressions.

disable

Disable one or more breakpoints.

enable

Enable one or more breakpoints.

hbreak

Set a hardware-assisted breakpoint.

ignore

Set the ignore-count of a particular breakpoint.

rbreak

Set a breakpoint for all functions matching a regular expression.

rwatch

Set a read watchpoint for an expression.

tbreak

Set a temporary breakpoint.

tcatch

Set a temporary catchpoint.

thbreak

Set a temporary hardware-assisted breakpoint.

watch

Set an expression watchpoint.

Examining Data

call

Call a function in the program.

delete display

Cancel one or more expressions that have been set to display when the program stops.

delete mem

Delete a memory region.

disable display

Disable one or more ...

Get GDB Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.