From Wikipedia:
long
: Long signed integer type. Capable of containing at least the [−2,147,483,647, +2,147,483,647] range; thus, it is at least 32 bits in size.
From man ptrace
:
long ptrace(enum __ptrace_request request, pid_t pid, void *addr, void *data);
Remember that signed overflow is undefined behavior in C. The registers on x86_64 store 64-bit values.
Is it thus unsafe to read the contents of the registers (e.g. ORIG_RAX
) with ptrace
on x86_64?