This is the mail archive of the
mailing list for the GDB project.
Re: Reading target registers
On Mon, May 09, 2005 at 12:44:05PM -0700, Bloch, Jack wrote:
> While this is not a direct GDB question, I'm hoping someone can answer me. I
> have an application which uses the ptrace interface to attach to a target
> process and read the target registers (I'm specifically interested in the
> EIP). It will run on a SuSE 2.6 Kernel x86 based machine. My code is below.
You can only use PTRACE_GETREGS when the process is stopped; that may
be the problem. After attaching be sure to wait(). Otherwise, try
stracing to see what's going on.