I am trying to use the pt_regs struct to get and set registers such as eax, but compilation errors tell me that pt_regs has no such member eax.
However, I am able to get the ax register. Can anybody tell me what is happening?
I am using 32-bit Ubuntu linux with the 3.0.0 kernel. Thank you again.
Take a look at the definition of
struct pt_regsin arch/x86/include/asm/ptrace.h.Notice
#ifndef __KERNEL__stuff there, it means that the definition of that structure is different for kernel-mode and user-mode code.For the kernel code,
pt_regs::axis probably the value you need. It should contain the value of%eaxon a 32-bit system and%raxon a 64-bit one.