Introduction to GDB

The basics

Start with "GDB executable"

The default GDB prompt is (gdb)

run the program with "start"

This sets a breakpoint on the "main" function.

Use "next" or "n" to step to the next line.

Use "step" or "s" to step into a function

Use "print" or "p" to print a variable

Use "list" or "l" to list source

GDB CLI

The basic idea to remember is that pressing Return repeats the last command.

GDB has only a limited programming language. In particular it doesn't have a way to put more than one command on a line. However you can use macros to run several commands with a single name, and this can be repeated using the Return or Enter key.

Download

Download this Presentation
www.s5easy.com/2095/download/