if(WIFSTOPPED(status)){.....
user uregs1={};
ptrace(PTRACE_GETREGS,rpid,NULL,&uregs1);
printf("rip0=%lx\n",uregs1.regs.rip);fflush(stdout);
ptrace(PTRACE_SINGLESTEP, tid, 0, 0); //let it continue one step
tid=waitpid(-1, &status, __WALL);
ptrace(PTRACE_GETREGS,rpid,NULL,&uregs1);
printf("rip0=%lx\n",uregs1.regs.rip);fflush(stdout);
both print the same RIP (after executing one instruction)...this probably tells me that the first RIP value was incorrect (and now ptrace with single step is required to get the right value), probably incorrect due to the pipeline nature of a processor
|