Fixed obtaining the registers on Linux
This commit is contained in:
parent
1ea24ab2ac
commit
57f8840e46
|
@ -119,7 +119,11 @@ static void _handle_trap_before(pid_t pid)
|
|||
struct user context;
|
||||
int size = sizeof(stracecall) / sizeof(*stracecall);
|
||||
|
||||
#ifdef __linux__
|
||||
ptrace(PT_GETREGS, pid, NULL, &context.regs);
|
||||
#else
|
||||
ptrace(PT_GETREGS, pid, &context.regs, 0);
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
_strace_regs_print(&context.regs);
|
||||
#endif
|
||||
|
@ -140,7 +144,11 @@ static void _handle_trap_after(pid_t pid)
|
|||
{
|
||||
struct user context;
|
||||
|
||||
#ifdef __linux__
|
||||
ptrace(PT_GETREGS, pid, NULL, &context.regs);
|
||||
#else
|
||||
ptrace(PT_GETREGS, pid, &context.regs, 0);
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
_strace_regs_print(&context.regs);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user