Show current position in disassembly with stepi command in GDB

72 views Asked by At

I have a code which is already compiled and I don't have the libraries to compile it myself again.

When I look into it with GDB, set a breakpoint and use the stepi (aka si) or nexti command, usually I get the next line of assembly code shown and can walk myself forward. Here however I just get the notification that I went to the next line in a given function, without showing me the next line of code.

So basically after every step I have to disassemble the function again to look where I am. How can I change that and why is that happening?

Picture for reference

1

There are 1 answers

1
Employed Russian On

So basicly after every step I have to disassemble the function again to look where I am. How can I change that and why is that happening ?

You can use display/i $pc to automatically show you the next instruction or display/4i $pc to show the next 4.

Or you could switch to TUI with layout asm.