Hi Wenji, while I cannot comment on your kernel code analysis the testcase was definitely broken since 2008-02-03 - it never PASSed. It should be fixed now.
/* We must set PC to our new function as the current PC stays in the glibc function RAISE no matter which part of the code called it - we would have to save and restore the whole stack for a proper restart of the code. */ I was not sure of its correctness, sorry for the delay. Regards, Jan On Thu, 13 Mar 2008 10:25:04 +0100, Wenji Huang wrote: > Hi, > > I made tests of step-jump-cont (utrace wiki page) on i686 and x86_64 with > upstream 2.6.24 kernel. They have different behaviors. > > With help of assert statement and stap script, I got the following > understandings: > > For i686: > 1. Wait child stop upon SIGUSR1 > 2. Set singlestep on child : child->ptrace |= PT_DTRACE && > regs->eflags |= TRAP_FLAG > 3. Change child regs->eflags |= TRAP_FLAG > 4. Continue the child and clear child->ptrace and regs->eflags due to > passed checking child->ptrace > 5. Wait child stop, got signal SIGUSR2 > 6. Change the child regs->eflags |= TRAP_FLAG > 7. Continue the child, but couldn't clear regs->eflags due to failed > checking child->ptrace > 8. Wait child, but got signal SIGTRAP due to eflags (Child stop on > sending SIGUSR2) > > For x86_64: > 1. Wait child stop upon SIGUSR1 > 2. Set singlestep on child : child->ptrace |= PT_DTRACE && > regs->eflags |= TRAP_FLAG. > (*** But these are missing after the syscall ***) > 3. Change child regs->eflags |= TRAP_FLAG > 4. Continue the child, but couldn't clear regs->eflags due to failed > checking child->ptrace > 5. Wait child, but got signal SIGTRAP due to eflags (Child stop on > sending SIGUSR1). > > So I think it may be correct in i686 case, just need to change testcase. > But it looks like there are some problems in x86_64 code. > > Regards, > Wenji