#GDB Cheatsheet

1). break main – Breaks main :P, basically sets a breakpoint at main entry point.

2). clear main –> removes bp

3). watch -> to tell whenever a variable changes, VERY critical.

4). run -> runs the program

5). print varname -> prints value of a variable

6). step -> steps into a function

7). next -> steps over a function

8). continue -> continues until the next breakpoint or watch point

9). list -> prints the code

10). quit -> ends

11). disassemble -> prints the assembly

12). set disassemly-flavor intel for intel syntax

13). x/xg x/s x/s etc are for examining the registers

14). set values using set $rax = pewpew