Skip to content

Instantly share code, notes, and snippets.

@Ascor8522
Created February 12, 2019 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ascor8522/bec7b6af38ac1ca6b6bc38c85c2fdd64 to your computer and use it in GitHub Desktop.
Save Ascor8522/bec7b6af38ac1ca6b6bc38c85c2fdd64 to your computer and use it in GitHub Desktop.
A cheatsheet in French with a few useful commands for the GNU Debugger

gdb cheatsheet

Lancer gdb

Par défaut

gdb <filename>

Avec arguments :

gdb --args <filename> <?arg1> <?arg2> ..

Lancer le debuggage

Par défaut

run

Au début du programme

start

Avec arguments :

start args <?arg1> <?arg2> ...

Avancer dans le programme

step
s

Prochaine instrution au même niveau

next
n

Aller jusqu'à la fin de la fonction

finish
fin

Continuer l'exécution du programme

continue
c

Arrêter / Terminer le programme

Arrêter le debuggage

stop

Tuer

kill
k

Quitter gdb

quit
q

Breakpoints/Watch

Ajouter breakpoint

break <?ligne/?nom fonction>
b <?ligne/?nom fonction>

Retirer un breakpoint

delete <?numero breakpoint/tous les breakpoints>
d <?numero breakpoint/tous les breakpoints>

Afficher tous les breakpoints

info breakpoints
i b

Afficher un registre

info register <nom registre>
i r <nom registre>
p $<nom registre>

Afficher tous les registres

info registers
i r

Afficher un binaire

<commande> /t <registre>

Surveiller variable (arrête programme à chaque modif)

watch <nom variable/adresse>

Afficher la variable

print <variable>
p <variable>

Stacktrace

Afficher stacktrace

where/backtrace/backtrace full
wh/f

Autre

Aide

help <?commande>
h <?commande>

Effacer l'écran

Ctrl + L

Afficher le programme où stoppé

list

https://ccrma.stanford.edu/~jos/stkintro/Useful_commands_gdb.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment