From f215e02bf85f68d3a6106c2a1f4f7f063f819064 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 11 Apr 2024 10:17:27 +0200 Subject: Adding upstream version 7.0.14-dfsg. Signed-off-by: Daniel Baumann --- .../onnv/cmd/dtrace/test/tst/i386/pid/Makefile.kup | 0 .../cmd/dtrace/test/tst/i386/pid/tst.badinstr.d | 40 ++++++++ .../cmd/dtrace/test/tst/i386/pid/tst.badinstr.s | 41 ++++++++ .../onnv/cmd/dtrace/test/tst/i386/pid/tst.branch.d | 78 ++++++++++++++ .../onnv/cmd/dtrace/test/tst/i386/pid/tst.branch.s | 73 +++++++++++++ .../cmd/dtrace/test/tst/i386/pid/tst.embedded.d | 73 +++++++++++++ .../cmd/dtrace/test/tst/i386/pid/tst.embedded.s | 68 ++++++++++++ .../onnv/cmd/dtrace/test/tst/i386/pid/tst.ret.d | 76 ++++++++++++++ .../onnv/cmd/dtrace/test/tst/i386/pid/tst.ret.s | 114 +++++++++++++++++++++ .../cmd/dtrace/test/tst/i386/pid/tst.retlist.ksh | 50 +++++++++ .../cmd/dtrace/test/tst/i386/pid/tst.retlist.s | 51 +++++++++ 11 files changed, 664 insertions(+) create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.badinstr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.badinstr.s create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.branch.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.branch.s create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.embedded.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.embedded.s create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.ret.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.ret.s create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.retlist.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.retlist.s (limited to 'src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid') 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 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 + + 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 + + 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 + + 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 + + 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 + + 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) -- cgit v1.2.3