Ask Sawal

Discussion Forum
Notification Icon1
Write Answer Icon
Add Question Icon

gdb where am i?

3 Answer(s) Available
Answer # 1 #
  • 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.
[4]
Edit
Query
Report
Manti Chiuswa
BRASS WIND INSTRUMENT MAKER
Answer # 2 #

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

[3]
Edit
Query
Report
Rach qfuor
EARTH BORING MACHINE OPERATOR
Answer # 3 #

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.

[0]
Edit
Query
Report
nozhr Pedro
JEWEL BEARING POLISHER