Gdb Refresher
GDB Refresher
Compiling a c program and running it
1
gcc -g program.c -o program
- To call run the debugger on the program now all you need to do is
gdb program
Focus
- You can change the focus of where the arrow keys interact with
- Focus on the src
Focus src
- Focus on the command line
Focus cmd
- Focus on the src
Layouts
You can change the focus of different parts of the gdb interface
Printing
- Printing the value that is stored in a variable
p/my_variable
- Printing the memory location of a variable
x/1c &my_variable
x/1c my_ptr
This post is licensed under CC BY 4.0 by the author.