summaryrefslogtreecommitdiffstats
path: root/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386')
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/Makefile51
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/Makefile.kup0
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/arrays/Makefile.kup0
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/arrays/tst.uregsarray.d63
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/Makefile.kup0
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyin.d52
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyinstr.d52
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyout.d56
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyoutstr.d56
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/Makefile.kup0
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.badinstr.d40
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.badinstr.s41
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.branch.d78
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.branch.s73
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.embedded.d73
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.embedded.s68
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.ret.d76
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.ret.s114
-rwxr-xr-xsrc/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.retlist.ksh50
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.retlist.s51
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/Makefile.kup0
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/annotated_helper.d32
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/helper_helper.d32
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.annotated.c43
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d35
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d.out4
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.circstack.d46
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.circstack.s43
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.helper.c82
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.helper.d44
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.helper.d.out4
31 files changed, 1359 insertions, 0 deletions
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/Makefile
new file mode 100644
index 00000000..05e9a039
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/Makefile
@@ -0,0 +1,51 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+include ../Makefile.com
+
+ASFLAGS += -P -D_ASM $(CPPFLAGS)
+CLOBBER_FILES += helper_helper.o annotated_helper.o
+
+# For the helper test we require an executable data section.
+ustack/tst.helper.exe := MAPFILE.NED=
+
+ustack/tst.helper.exe: ustack/tst.helper.o ustack/helper_helper.o
+ $(LINK.c) -o ustack/tst.helper.exe \
+ ustack/tst.helper.o ustack/helper_helper.o $(LDLIBS)
+ $(POST_PROCESS) ; $(STRIP_STABS)
+
+ustack/helper_helper.o: ustack/helper_helper.d
+ $(COMPILE.d) -o ustack/helper_helper.o -s ustack/helper_helper.d
+
+ustack/tst.annotated.exe: ustack/tst.annotated.o ustack/annotated_helper.o
+ $(LINK.c) -o ustack/tst.annotated.exe \
+ ustack/tst.annotated.o ustack/annotated_helper.o $(LDLIBS)
+ $(POST_PROCESS) ; $(STRIP_STABS)
+
+ustack/annotated_helper.o: ustack/annotated_helper.d
+ $(COMPILE.d) -o ustack/annotated_helper.o -s ustack/annotated_helper.d
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/Makefile.kup
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/Makefile.kup
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/arrays/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/arrays/Makefile.kup
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/arrays/Makefile.kup
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/arrays/tst.uregsarray.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/arrays/tst.uregsarray.d
new file mode 100644
index 00000000..5543c0a5
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/arrays/tst.uregsarray.d
@@ -0,0 +1,63 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Positive test to make sure that we can invoke x86
+ * ureg[] aliases.
+ *
+ * SECTION: User Process Tracing/uregs Array
+ *
+ * NOTES: This test does no verification - the value of the output
+ * is not deterministic.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("R_GS = 0x%x\n", uregs[R_GS]);
+ printf("R_ES = 0x%x\n", uregs[R_ES]);
+ printf("R_DS = 0x%x\n", uregs[R_DS]);
+ printf("R_EDI = 0x%x\n", uregs[R_EDI]);
+ printf("R_ESI = 0x%x\n", uregs[R_ESI]);
+ printf("R_EBP = 0x%x\n", uregs[R_EBP]);
+ printf("R_EBX = 0x%x\n", uregs[R_EBX]);
+ printf("R_EDX = 0x%x\n", uregs[R_EDX]);
+ printf("R_ECX = 0x%x\n", uregs[R_ECX]);
+ printf("R_EAX = 0x%x\n", uregs[R_EAX]);
+ printf("R_TRAPNO = 0x%x\n", uregs[R_TRAPNO]);
+ printf("R_ERR = 0x%x\n", uregs[R_ERR]);
+ printf("R_EIP = 0x%x\n", uregs[R_EIP]);
+ printf("R_CS = 0x%x\n", uregs[R_CS]);
+ printf("R_EFL = 0x%x\n", uregs[R_EFL]);
+ printf("R_UESP = 0x%x\n", uregs[R_UESP]);
+ printf("R_SS = 0x%x\n", uregs[R_SS]);
+ exit(0);
+}
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/Makefile.kup
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/Makefile.kup
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyin.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyin.d
new file mode 100644
index 00000000..f14c8afc
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyin.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * On IA/32, there is a single 32-bit address space that is partitioned
+ * between user-level and kernel-level. copyin()/copyinstr() and
+ * copyout()/copyoutstr() must check that addresses specified as
+ * user-level addresses are actually at user-level. This test attempts
+ * to perform an illegal copyin() from a kernel address. It asserts that
+ * the fault type is DTRACEFLT_BADADDR and that the bad address is set to
+ * the kernel address from which the copyin() was attempted.
+ *
+ * SECTION: Actions and Subroutines/copyin();
+ * Actions and Subroutines/copyin();
+ * User Process Tracing/copyin() and copyinstr()
+ */
+
+BEGIN
+{
+ dtrace_zero = copyin((uintptr_t)&`dtrace_zero, sizeof (int));
+ exit(1);
+}
+
+ERROR
+{
+ exit(arg4 == DTRACEFLT_BADADDR &&
+ arg5 == (uint64_t)&`dtrace_zero ? 0 : 1);
+}
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyinstr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyinstr.d
new file mode 100644
index 00000000..ac049936
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyinstr.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * On IA/32, there is a single 32-bit address space that is partitioned
+ * between user-level and kernel-level. copyin()/copyinstr() and
+ * copyout()/copyoutstr() must check that addresses specified as
+ * user-level addresses are actually at user-level. This test attempts
+ * to perform an illegal copyinstr() from a kernel address. It asserts
+ * that the fault type is DTRACEFLT_BADADDR and that the bad address is
+ * set to the kernel address from which the copyinstr() was attempted.
+ *
+ * SECTION: Actions and Subroutines/copyinstr();
+ * User Process Tracing/copyin() and copyinstr()
+ */
+
+BEGIN
+{
+ os = copyinstr((uintptr_t)&`utsname);
+ exit(1);
+}
+
+ERROR
+{
+ exit(arg4 == DTRACEFLT_BADADDR && arg5 == (uint64_t)&`utsname ? 0 : 1);
+}
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyout.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyout.d
new file mode 100644
index 00000000..8909cd3a
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyout.d
@@ -0,0 +1,56 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * On IA/32, there is a single 32-bit address space that is partitioned
+ * between user-level and kernel-level. copyin()/copyinstr() and
+ * copyout()/copyoutstr() must check that addresses specified as
+ * user-level addresses are actually at user-level. This test attempts
+ * to perform an illegal copyout() to a kernel address. It asserts that
+ * the fault type is DTRACEFLT_BADADDR and that the bad address is set to
+ * the kernel address to which the copyout() was attempted.
+ *
+ * SECTION: Actions and Subroutines/copyout()
+ *
+ */
+
+#pragma D option destructive
+
+BEGIN
+{
+ this->a = (uint32_t *)alloca(4);
+ *this->a = -1;
+ copyout(this->a, (uintptr_t)&`clock, 4);
+ exit(1);
+}
+
+ERROR
+{
+ exit(arg4 == DTRACEFLT_BADADDR && arg5 == (uint64_t)&`clock ? 0 : 1);
+}
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyoutstr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyoutstr.d
new file mode 100644
index 00000000..d7166cd2
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyoutstr.d
@@ -0,0 +1,56 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * On IA/32, there is a single 32-bit address space that is partitioned
+ * between user-level and kernel-level. copyin()/copyinstr() and
+ * copyout()/copyoutstr() must check that addresses specified as
+ * user-level addresses are actually at user-level. This test attempts
+ * to perform an illegal copyoutstr() to a kernel address. It asserts
+ * that the fault type is DTRACEFLT_BADADDR and that the bad address is
+ * set to the kernel address to which the copyoutstr() was attempted.
+ *
+ * SECTION: Actions and Subroutines/copyoutstr()
+ *
+ */
+
+#pragma D option destructive
+
+BEGIN
+{
+ this->str = alloca(10);
+ bcopy("kablammo!", this->str, 10);
+ copyoutstr(this->str, (uintptr_t)&`clock, 10);
+ exit(1);
+}
+
+ERROR
+{
+ exit(arg4 == DTRACEFLT_BADADDR && arg5 == (uint64_t)&`clock ? 0 : 1);
+}
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/Makefile.kup
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/Makefile.kup
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.badinstr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.badinstr.d
new file mode 100644
index 00000000..50753b8a
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.badinstr.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Make sure that DTrace doesn't explode on an invalid instruction.
+ */
+
+pid$1:a.out:badfunc:entry
+{
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.badinstr.s b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.badinstr.s
new file mode 100644
index 00000000..27f7f991
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.badinstr.s
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/asm_linkage.h>
+
+ DGDEF(__fsr_init_value)
+ .long 0
+
+ ENTRY(badfunc)
+ .byte 0xff
+ .byte 0xff
+ SET_SIZE(badfunc)
+
+ ENTRY(main)
+1: jmp 1b
+ SET_SIZE(main)
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.branch.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.branch.d
new file mode 100644
index 00000000..cfcf0a71
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.branch.d
@@ -0,0 +1,78 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * SECTION:
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option destructive
+
+pid$1:a.out:waiting:entry
+{
+ this->a = (char *)alloca(1);
+ *this->a = 1;
+ copyout(this->a, arg0, 1);
+}
+
+pid$1:a.out:main:,
+pid$1:a.out:other:
+{
+}
+
+pid$1:a.out:bad:entry
+{
+ exit(1);
+}
+
+syscall::rexit:entry
+/pid == $1/
+{
+ exit(0);
+}
+
+
+BEGIN
+{
+ /*
+ * Let's just do this for 5 seconds.
+ */
+ timeout = timestamp + 5000000000;
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ trace("test timed out");
+ exit(1);
+}
+
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.branch.s b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.branch.s
new file mode 100644
index 00000000..82a58920
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.branch.s
@@ -0,0 +1,73 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/asm_linkage.h>
+
+ DGDEF(__fsr_init_value)
+ .long 0
+
+ ENTRY(waiting)
+ pushl %ebp
+ movl %esp, %ebp
+ movl 8(%ebp), %eax
+ movl (%eax), %eax
+ popl %ebp
+ ret
+ SET_SIZE(waiting)
+
+ ENTRY(main)
+ pushl %ebp
+ movl %esp, %ebp
+ subl $0x4, %esp
+ movl $0x0, -4(%ebp)
+
+1:
+ leal -4(%ebp), %eax
+ pushl %eax
+ call waiting
+ addl $0x4, %esp
+
+ testl %eax, %eax
+ jz 1b
+
+ addl $0x4, %esp
+
+ xorl %eax, %eax
+ testl %eax, %eax
+ jz other
+
+ ALTENTRY(bad)
+ movl 0x0, %eax
+ SET_SIZE(bad)
+ SET_SIZE(main)
+
+ ENTRY(other)
+ xorl %eax, %eax
+ popl %ebp
+ ret
+ SET_SIZE(other)
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.embedded.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.embedded.d
new file mode 100644
index 00000000..c484c3f0
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.embedded.d
@@ -0,0 +1,73 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * SECTION:
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option destructive
+
+pid$1:a.out:waiting:entry
+{
+ this->a = (char *)alloca(1);
+ *this->a = 1;
+ copyout(this->a, arg0, 1);
+}
+
+pid$1:a.out:main:,
+pid$1:a.out:inner:
+{
+}
+
+syscall::rexit:entry
+/pid == $1/
+{
+ exit(0);
+}
+
+
+BEGIN
+{
+ /*
+ * Let's just do this for 5 seconds.
+ */
+ timeout = timestamp + 5000000000;
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ trace("test timed out");
+ exit(1);
+}
+
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.embedded.s b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.embedded.s
new file mode 100644
index 00000000..134a5aff
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.embedded.s
@@ -0,0 +1,68 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/asm_linkage.h>
+
+ DGDEF(__fsr_init_value)
+ .long 0
+
+ ENTRY(waiting)
+ pushl %ebp
+ movl %esp, %ebp
+ movl 8(%ebp), %eax
+ movl (%eax), %eax
+ popl %ebp
+ ret
+ SET_SIZE(waiting)
+
+ ENTRY(main)
+ pushl %ebp
+ movl %esp, %ebp
+ subl $0x4, %esp
+ movl $0x0, -4(%ebp)
+1:
+ leal -4(%ebp), %eax
+ pushl %eax
+ call waiting
+ addl $0x4, %esp
+
+ testl %eax, %eax
+ jz 1b
+
+ addl $0x4, %esp
+
+ ALTENTRY(inner)
+ nop
+ nop
+ nop
+ SET_SIZE(inner)
+
+ xorl %eax, %eax
+ popl %ebp
+ ret
+ SET_SIZE(main)
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.ret.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.ret.d
new file mode 100644
index 00000000..358466fe
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.ret.d
@@ -0,0 +1,76 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Validated the emulation of various flavors of the return
+ * instruction.
+ */
+
+#pragma D option destructive
+
+pid$1:a.out:waiting:entry
+{
+ this->a = (char *)alloca(1);
+ *this->a = 1;
+ copyout(this->a, arg0, 1);
+}
+
+pid$1:a.out:ret*:
+{
+ printf("%%sp = %x", uregs[R_SP]);
+}
+
+pid$1:a.out:ret*:return
+{
+}
+
+pid$1:a.out:done:entry
+{
+ exit(0);
+}
+
+pid$1:a.out:main:return
+{
+ printf("%%eax = %x", uregs[R_EAX]);
+}
+
+BEGIN
+{
+ /*
+ * Let's just do this for 5 seconds.
+ */
+ timeout = timestamp + 5000000000;
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ trace("test timed out");
+ exit(1);
+}
+
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.ret.s b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.ret.s
new file mode 100644
index 00000000..bccdb1a3
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.ret.s
@@ -0,0 +1,114 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/asm_linkage.h>
+
+ DGDEF(__fsr_init_value)
+ .long 0
+
+ ENTRY(ret1)
+ ret
+ SET_SIZE(ret1)
+
+ ENTRY(ret2)
+ repz
+ ret
+ SET_SIZE(ret2)
+
+ ENTRY(ret3)
+ ret $0
+ SET_SIZE(ret3)
+
+ ENTRY(ret4)
+ repz
+ ret $0
+ SET_SIZE(ret4)
+
+ ENTRY(ret5)
+ pushl (%esp)
+ ret $4
+ SET_SIZE(ret5)
+
+ ENTRY(ret6)
+ pushl (%esp)
+ repz
+ ret $4
+ SET_SIZE(ret6)
+
+ ENTRY(waiting)
+ pushl %ebp
+ movl %esp, %ebp
+ movl 8(%ebp), %eax
+ movl (%eax), %eax
+ movl %ebp, %esp
+ popl %ebp
+ ret
+ SET_SIZE(waiting)
+
+ ENTRY(main)
+ pushl %ebp
+ movl %esp, %ebp
+ subl $0x4, %esp
+ movl $0x0, -4(%ebp)
+
+1:
+ leal -4(%ebp), %eax
+ pushl %eax
+ call waiting
+ addl $0x4, %esp
+
+ testl %eax, %eax
+ jz 1b
+
+ movl %esp, %esi
+
+ call ret1
+ call ret2
+ call ret3
+ call ret4
+ call ret5
+ call ret6
+
+ cmpl %esp, %esi
+ jne 1f
+
+ ALTENTRY(done)
+ nop
+ SET_SIZE(done)
+
+ movl $0, %eax
+ movl %ebp, %esp
+ popl %ebp
+ ret
+
+1:
+ movl $1, %eax
+ movl %ebp, %esp
+ popl %ebp
+ ret
+ SET_SIZE(main)
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.retlist.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.retlist.ksh
new file mode 100755
index 00000000..5477f5c9
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.retlist.ksh
@@ -0,0 +1,50 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+# Make sure we can match against 2-byte rets
+
+./tst.retlist.exe&
+PID=$!
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+match=`$dtrace -l -n pid$PID:a.out:simple: -n pid$PID:a.out:complex: | wc -l`
+
+kill $PID
+
+if [ "$match" -ne 12 ]; then
+ echo wrong number of matched probes: $match
+ exit 1
+fi
+
+exit 0
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.retlist.s b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.retlist.s
new file mode 100644
index 00000000..e85e9f5c
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.retlist.s
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/asm_linkage.h>
+
+ DGDEF(__fsr_init_value)
+ .long 0
+
+ ENTRY(simple)
+ repz
+ ret
+ SET_SIZE(simple)
+
+ ENTRY(complex)
+ pushl %ebp
+ movl %esp, %ebp
+ movl 8(%ebp), %eax
+ movl (%eax), %eax
+ popl %ebp
+ repz
+ ret
+ SET_SIZE(complex)
+
+ ENTRY(main)
+1: jmp 1b
+ SET_SIZE(main)
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/Makefile.kup
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/Makefile.kup
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/annotated_helper.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/annotated_helper.d
new file mode 100644
index 00000000..3b977097
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/annotated_helper.d
@@ -0,0 +1,32 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+dtrace:helper:ustack:
+{
+ "@it's annotated"
+}
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/helper_helper.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/helper_helper.d
new file mode 100644
index 00000000..8abc47d0
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/helper_helper.d
@@ -0,0 +1,32 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+dtrace:helper:ustack:
+{
+ "<it's working>"
+}
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.annotated.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.annotated.c
new file mode 100644
index 00000000..8cdf8aba
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.annotated.c
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+int
+baz(void)
+{
+ return (8);
+}
+
+int
+main(int argc, char **argv)
+{
+ for (;;) {
+ baz();
+ }
+
+ return (0);
+}
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d
new file mode 100644
index 00000000..dd795bec
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d
@@ -0,0 +1,35 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+pid$1:a.out:baz:entry
+{
+ ustack(1, 1024);
+ exit(0);
+}
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d.out
new file mode 100644
index 00000000..806d6a2b
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d.out
@@ -0,0 +1,4 @@
+
+ tst.annotated.exe`baz
+ [ it's annotated ]
+
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.circstack.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.circstack.d
new file mode 100644
index 00000000..78218bd7
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.circstack.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+syscall::getpid:entry
+/pid == $1/
+{
+ @[ustackdepth] = count();
+}
+
+ERROR
+/arg4 == DTRACEFLT_BADSTACK/
+{
+ exit(0);
+}
+
+profile:::tick-1s
+/++n == 10/
+{
+ exit(1)
+}
+
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.circstack.s b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.circstack.s
new file mode 100644
index 00000000..3bf7c0bf
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.circstack.s
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/asm_linkage.h>
+
+ DGDEF(__fsr_init_value)
+ .long 0
+
+ ENTRY(main)
+ pushl %ebp
+ movl %esp, %ebp
+ movl %esp, (%ebp)
+loop:
+ call getpid
+ jmp loop
+ leave
+ ret
+ SET_SIZE(main)
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.helper.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.helper.c
new file mode 100644
index 00000000..69ab6a85
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.helper.c
@@ -0,0 +1,82 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <strings.h>
+
+int
+baz(void)
+{
+ return (8);
+}
+
+static int
+foo(void)
+{
+ /*
+ * In order to assure that our helper is properly employed to identify
+ * the frame, we're going to trampoline through data.
+ */
+ uint8_t instr[] = {
+ 0x55, /* pushl %ebp */
+ 0x8b, 0xec, /* movl %esp, %ebp */
+ 0xe8, 0x0, 0x0, 0x0, 0x0, /* call baz */
+ 0x8b, 0xe5, /* movl %ebp, %esp */
+ 0x5d, /* popl %ebp */
+ 0xc3 /* ret */
+ };
+ uint8_t *fp = malloc(sizeof (instr));
+
+ /*
+ * Do our little relocation dance.
+ */
+ *((int *)&instr[4]) = (uintptr_t)baz - (uintptr_t)&fp[8];
+
+ /*
+ * Copy the code to the heap (it's a pain to build in ON with an
+ * executable stack).
+ */
+ bcopy(instr, fp, sizeof (instr));
+
+ (*(int (*)(void))fp)();
+
+ free(fp);
+
+ return (0);
+}
+
+int
+main(int argc, char **argv)
+{
+ for (;;) {
+ foo();
+ }
+
+ return (0);
+}
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.helper.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.helper.d
new file mode 100644
index 00000000..ce2b9b30
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.helper.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * SECTION:
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+pid$1:a.out:baz:entry
+{
+ ustack(2, 1024);
+ exit(0);
+}
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.helper.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.helper.d.out
new file mode 100644
index 00000000..29646288
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.helper.d.out
@@ -0,0 +1,4 @@
+
+ tst.helper.exe`baz
+ <it's working>
+