O'Reilly logo

A Bug Hunter's Diary by Tobias Klein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

B.4 The GNU Debugger (gdb)

The following tables list some useful commands of the GNU Debugger (gdb). For a complete list of available commands, see the gdb online documentation.[94]

Starting and Stopping gdb

Command

Description

gdb program

Starts gdb with program to debug.

quit

Exits the debugger.

General Commands

Command

Description

run arguments

Starts debugged program (with arguments).

attach processID

Attaches the debugger to the running process with processID.

Breakpoints

Command

Description

break <file:> function

Sets a breakpoint at the beginning of the specified function (in file).

break <file:> line number

Sets a breakpoint at the start of the code for that line number (in file).

break *address

Sets a breakpoint at the specified address.

info breakpoints

Lists ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required