Date: Mon, 7 Nov 2011 01:55:58 +0000 (UTC) From: Ryan Stone <rstone@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r227291 - head/sys/cddl/contrib/opensolaris/uts/intel/dtrace Message-ID: <201111070155.pA71tw67051724@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rstone Date: Mon Nov 7 01:55:58 2011 New Revision: 227291 URL: http://svn.freebsd.org/changeset/base/227291 Log: Replace fasttrap_copyout() with uwrite(). FreeBSD copyout() is not able to write to the .text section of a process. Obtained from: rpaulo MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Nov 7 01:53:25 2011 (r227290) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Nov 7 01:55:58 2011 (r227291) @@ -97,7 +97,7 @@ uwrite(proc_t *p, void *kaddr, size_t le return (proc_ops(UIO_WRITE, p, kaddr, uaddr, len)); } -#endif +#endif /* sun */ #ifdef __i386__ #define r_rax r_eax #define r_rbx r_ebx @@ -1380,6 +1380,7 @@ fasttrap_pid_probe(struct reg *rp) { int ret = 0; uintptr_t addr = 0; + #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { addr = rp->r_rsp - sizeof (uintptr_t); @@ -1558,7 +1559,7 @@ fasttrap_pid_probe(struct reg *rp) * ------------------------ ----- * a: <original instruction> <= 15 * jmp <pc + tp->ftt_size> 5 - * b: <original instrction> <= 15 + * b: <original instruction> <= 15 * int T_DTRACE_RET 2 * ----- * <= 37 @@ -1731,12 +1732,16 @@ fasttrap_pid_probe(struct reg *rp) ASSERT(i <= sizeof (scratch)); + +#if defined(sun) if (fasttrap_copyout(scratch, (char *)addr, i)) { +#else + if (uwrite(curproc, scratch, i, addr)) { +#endif fasttrap_sigtrap(p, curthread, pc); new_pc = pc; break; } - if (tp->ftt_retids != NULL) { curthread->t_dtrace_step = 1; curthread->t_dtrace_ret = 1;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111070155.pA71tw67051724>