5.2. Getting Started with GDB

The GNU debugger is started using the gdb command. Upon startup, it displays initial information about the platform. It stops at the (gdb) command prompt where GDB commands can be used. A typical GDB screen is as shown below:

[rrehman@laptop gdb]$ gdb
GNU gdb 5.0rh-5 Red Hat Linux 7.1
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux".
(gdb)

General help about GDB commands can be displayed using the

Get Linux Development Platform: Configuring, Using, and Maintaining a Complete Programming Environment, The now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.