gdb where am i?
- step. Execute the next statement.
- next. Execute the next statement.
- continue. Contine the execution of the program until it reaches a breakpoint, a fatal error or finishes execution normally.
- where. Print out the function call stack including the current line number.
- list.
What you are looking for is called de instruction pointer, i.e:
more detail here
all registers available on gdb execution can be shown with:
with it you can find which mode your program is running (looking which of these registers exist)
then (here using most common register rip nowadays, replace with eip or very rarely ip if needed):
will show you line number and file source
will show you that line with a few before and after
The dynamic debugger utility, gdb, has a large number of capabilities. This quick guide lists a small but useful subset of the gdb commands.
Breakpoints are points in your code at which gdb will stop and allow executing other gdb commands.
There is a help command, h and the command to quit gdb is q.