I want to get the registers for a user process and was thinking of doing so using asm like so:
int regVal;
asm("movl %%eax, %0" : "=r"(regVal) :);
For a user process calling asm does the call change the process's registers? I'm worried about things like the instruction pointer changing changing from the asm call.
Is there an easier way to store/retrieve the values of all registers from a user process at once?
EDIT: my compiler is Apple clang version 11.0.0 (clang-1100.0.33.17)