From 1f2ae23628ccb32ca009360c060dc8f81b3d267f Mon Sep 17 00:00:00 2001 From: Lucas Werkmeister Date: Mon, 25 Nov 2013 23:19:11 +0100 Subject: [PATCH] Add a gdb cheat sheet --- cheatsheets/gdb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 cheatsheets/gdb diff --git a/cheatsheets/gdb b/cheatsheets/gdb new file mode 100644 index 0000000..76ef67e --- /dev/null +++ b/cheatsheets/gdb @@ -0,0 +1,26 @@ +# start the debugger +gdb your-executable + +# set a breakpoint +b some-method, break some-method + +# run the program +r, run + +# when a breakpoint was reached: + +# run the current line, stepping over any invocations +n, next +# run the current line, stepping into any invocations +s, step +# print a stacktrace +bt, backtrace +# evaluate an expression and print the result +p length=strlen(string) +# list surrounding source code +l, list +# continue execution +c, continue + +# exit gdb (after program terminated) +q, quit