When you execute a single step operation using ptrace does the process do one “line” of code or does it do one line of assembly instead. If it’s the former case is there a way to step a process in linux by one processor instruction only?
I mean to do this within the kernel but the GDB source is kind of large and it’s hard to track exactly what it’s doing to do it’s ASM singlestepping. I want to single step a process it’s just that I’m not sure what the exact behavior of ptrace’s single step is (just 1 instruction or more?)
It does one line of assembly. You can verify this by opening two sessions, in one session you can have your program running which displays the contents of IP register( EIP in 32 bit and RIP in 64 bit) and in other run objdump using the following command – objdump -d -j.code | less and verify