GDB

Start GDB (with optional core dump).

1
gdb <program> [core dump]

Start GDB and pass arguments

1
# gdb --args <program> <args…>

Start GDB and attach to process.

1
# gdb --pid <pid>

Set arguments to pass to program to be debugged.

1
set args <args...>

Run the program to be debugged.

1
run

Kill the running program.

1
kill

Breakpoints

Set a new breakpoint.

1
break <where>

Remove a breakpoint.

1
delete <breakpoint#>

Delete all breakpoints.

1
clear

Enable a disabled breakpoint.

1
enable <breakpoint#>

Disable a breakpoint.

1
disable <breakpoint#>

Watchpoints

Set a new watchpoint.

1
watch <where>