Some useful comands for debugging C/C++ applications using GDB from command line:
Starting GDB:
- Attach to a running process: gdb -p
pidof running_process
- Start GDB attached to the application you want to debug:
gdb application_name
Step through code:
- Start the execution by using
run
orstart
- Continue execution by using
continue
- Step through code with
next
for step over and withstep
for step into - Print value of the argument using
print
.
More resources are available HERE