I'm outside the gdb executable, and I donβt even have a stack that fits this purpose. I still want to take a one-step step so that I can check what happens in my assembler because I'm not an expert in x86 assembly. Unfortunately, gdb refuses to do this simple assembly-level debugging. This allows me to set and stop the appropriate breakpoint, but as soon as I try to take a single step forward, gdb reports the error "Unable to find the restrictions of the current function", and EIP does not change.
Additional Information:
The machine code was generated by the gcc asm statements, and I copied it to the kernel memory cell where it runs from the output of objdump -d. I would not mind using an easy way to use the loader to load my object code to a moved address, but remember that loading should be done in the kernel module.
I believe that another alternative would be to create a fake kernel module or debug info file to give gdb to make it believe that this area is in the program code. gdb works fine on the executable kernel itself.
(For those who really want to know, I paste the code at runtime into the Linux kernel data space inside VMware VM and debug it from remote gdb debugging using the gdb stub built into VMware Workstation. Do not write kernel exploits, I'm a security graduate student writing a prototype .)
(I can set a breakpoint for each command inside my assembly. This works, but will be quite laborious after a while, since the size of the x86 assembly instructions changes and the assembly location changes every time I reboot.)
assembly x86 linux linux-kernel gdb
Paul Mar 10 '10 at 21:36 2010-03-10 21:36
source share