/* *Calledbykernel/ptrace.cwhendetaching.. * *Makesuresinglestepbitsetcarenotset.
*/ void ptrace_disable(struct task_struct *child)
{ /* make sure the single step bit is not set. */
user_disable_single_step(child);
}
long arch_ptrace(struct task_struct *child, long request, unsignedlong addr, unsignedlong data)
{ int ret = -EPERM; void __user *datavp = (void __user *) data; unsignedlong __user *datalp = datavp;
switch (request) { /* read the word at location addr in the USER area. */ case PTRACE_PEEKUSR: { unsignedlong index, tmp;
ret = -EIO; /* convert to index and check */
index = addr / sizeof(long); if ((addr & (sizeof(long) - 1)) || !child->thread.regs) break;
if (index < PT_FPR0)
ret = ptrace_get_reg(child, (int) index, &tmp); else
ret = ptrace_get_fpr(child, index, &tmp);
if (ret) break;
ret = put_user(tmp, datalp); break;
}
/* write the word at location addr in the USER area */ case PTRACE_POKEUSR: { unsignedlong index;
ret = -EIO; /* convert to index and check */
index = addr / sizeof(long); if ((addr & (sizeof(long) - 1)) || !child->thread.regs) break;
if (index < PT_FPR0)
ret = ptrace_put_reg(child, index, data); else
ret = ptrace_put_fpr(child, index, data); break;
}
case PPC_PTRACE_GETHWDBGINFO: { struct ppc_debug_info dbginfo;
ppc_gethwdinfo(&dbginfo);
if (copy_to_user(datavp, &dbginfo, sizeof(struct ppc_debug_info))) return -EFAULT; return0;
}
case PPC_PTRACE_SETHWDEBUG: { struct ppc_hw_breakpoint bp_info;
case PPC_PTRACE_DELHWDEBUG: {
ret = ppc_del_hwdebug(child, data); break;
}
case PTRACE_GET_DEBUGREG:
ret = ptrace_get_debugreg(child, addr, datalp); break;
case PTRACE_SET_DEBUGREG:
ret = ptrace_set_debugreg(child, addr, data); break;
#ifdef CONFIG_PPC64 case PTRACE_GETREGS64: #endif case PTRACE_GETREGS: /* Get all pt_regs from the child. */ return copy_regset_to_user(child, &user_ppc_native_view,
REGSET_GPR, 0, sizeof(struct user_pt_regs),
datavp);
#ifdef CONFIG_PPC64 case PTRACE_SETREGS64: #endif case PTRACE_SETREGS: /* Set all gp regs in the child. */ return copy_regset_from_user(child, &user_ppc_native_view,
REGSET_GPR, 0, sizeof(struct user_pt_regs),
datavp);
case PTRACE_GETFPREGS: /* Get the child FPU state (FPR0...31 + FPSCR) */ return copy_regset_to_user(child, &user_ppc_native_view,
REGSET_FPR, 0, sizeof(elf_fpregset_t),
datavp);
case PTRACE_SETFPREGS: /* Set the child FPU state (FPR0...31 + FPSCR) */ return copy_regset_from_user(child, &user_ppc_native_view,
REGSET_FPR, 0, sizeof(elf_fpregset_t),
datavp);
// Now check that the pt_regs offsets match the uapi #defines #define CHECK_REG(_pt, _reg) \
BUILD_BUG_ON(_pt != (offsetof(struct user_pt_regs, _reg) / \ sizeof(unsignedlong)));
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.