Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Feb 2014 13:02:09 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r262044 - stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace
Message-ID:  <201402171302.s1HD29UY049691@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Mon Feb 17 13:02:09 2014
New Revision: 262044
URL: http://svnweb.freebsd.org/changeset/base/262044

Log:
  MFC r257143: Fix a couple of bugs in the fasttrap emulation of a "push %rbp"

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c	Mon Feb 17 12:57:53 2014	(r262043)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c	Mon Feb 17 13:02:09 2014	(r262044)
@@ -104,6 +104,7 @@ uwrite(proc_t *p, void *kaddr, size_t le
 #define	r_rip	r_eip
 #define	r_rflags r_eflags
 #define	r_rsp	r_esp
+#define	r_rbp	r_ebp
 #endif
 
 /*
@@ -1381,29 +1382,27 @@ fasttrap_pid_probe(struct reg *rp)
 	case FASTTRAP_T_PUSHL_EBP:
 	{
 		int ret = 0;
-		uintptr_t addr = 0;
 
 #ifdef __amd64
 		if (p->p_model == DATAMODEL_NATIVE) {
-			addr = rp->r_rsp - sizeof (uintptr_t);
-			ret = fasttrap_sulword((void *)addr, &rp->r_rsp);
+			rp->r_rsp -= sizeof (uintptr_t);
+			ret = fasttrap_sulword(&rp->r_rbp, (void *)rp->r_rsp);
 		} else {
 #endif
 #ifdef __i386__
-			addr = rp->r_rsp - sizeof (uint32_t);
-			ret = fasttrap_suword32((void *)addr, &rp->r_rsp);
+			rp->r_rsp -= sizeof (uint32_t);
+			ret = fasttrap_suword32(&rp->r_rbp, (void *)rp->r_rsp);
 #endif
 #ifdef __amd64
 		}
 #endif
 
 		if (ret == -1) {
-			fasttrap_sigsegv(p, curthread, addr);
+			fasttrap_sigsegv(p, curthread, rp->r_rsp);
 			new_pc = pc;
 			break;
 		}
 
-		rp->r_rsp = addr;
 		new_pc = pc + tp->ftt_size;
 		break;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402171302.s1HD29UY049691>