GDB

Adding debug symbols

gcc -g hello.c
gdb a.out
# Run program
run

# Run and immediately break
start

# View code at current break point
list

# Break main
b main

# Break at line 9
b 9

TUI mode - text user interface

Python interpreter built in (since version 7)

import os
print(os.pid())

python print(gdb.breakpoints()[0].location

# Set a breakpoint
python gdb.Breakpoint('7')

References