I'm trying to use ptrace
to access the registers of a particular thread in a child process. The values I'm getting seem to be junk however - they seem to be way out in the weeks. Here's what I mean:
RAX: fffffffffffffdfc
RBX: 7f0533fe7700
RCX: ffffffffffffffff
RDX: 0
RSI: 0
RDI: 7f0533fe6ea0
RBP: 7f0533fe6ed0
RSP: 7f0533fe6e70
RIP: 7f05345fab9d
I can believe RAX and RCX, but the stack pointer, instruction pointer, and block pointers are suspicious. On top of that, accessing those values with GDB crashes GDB (I didn't realize I could do that haha). Should I perhaps be using PTRACE_GETREGSET instead of PTRACE_GETREGS? I'm on an x86_64 system, so I didn't think it made a difference. Or should I be looking elsewhere?