Index: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.user64mode.ksh =================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.user64mode.ksh (revision 271692) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.user64mode.ksh (revision 271693) @@ -1,90 +1,90 @@ #! /usr/bin/ksh # # # This file and its contents are supplied under the terms of the # Common Development and Distribution License ("CDDL"), version 1.0. # You may only use this file in accordance with the terms of version # 1.0 of the CDDL. # # A full copy of the text of the CDDL should have accompanied this # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # # Copyright (c) 2013 Joyent, Inc. All rights reserved. # # # This test is purposefully using a 64-bit DTrace and thus 64-bit types # when compared with a 32-bit process. This test uses the userland # keyword and so the implicit copyin should access illegal memory and # thus exit. # if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>' exit 2 fi dtrace=$1 t="zelda_info_t" exe="tst.chasestrings.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -ne 0 ]]; then echo "CTF does not exist in $exe, that's a bug" >&2 exit 1 fi ./$exe & pid=$! $dtrace -64 -qs /dev/stdin <t = (userland info_t *)arg0; printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n", stringof(this->t->zi_gamename), this->t->zi_ndungeons, stringof(this->t->zi_villain), this->t->zi_haszelda); next = 1; } pid$pid::has_dungeons:entry /next == 1/ { this->t = (userland info_t *)arg0; printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n", stringof(this->t->zi_gamename), this->t->zi_ndungeons, stringof(this->t->zi_villain), this->t->zi_haszelda); next = 2; } pid$pid::has_villain:entry /next == 2/ { this->t = (userland info_t *)arg0; printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n", stringof(this->t->zi_gamename), this->t->zi_ndungeons, stringof(this->t->zi_villain), this->t->zi_haszelda); exit(0); } ERROR { exit(1); } EOF rc=$? kill -9 $pid exit $rc Index: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.aouttype.ksh =================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.aouttype.ksh (revision 271692) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.aouttype.ksh (revision 271693) @@ -1,44 +1,44 @@ #! /usr/bin/ksh # # # This file and its contents are supplied under the terms of the # Common Development and Distribution License ("CDDL"), version 1.0. # You may only use this file in accordance with the terms of version # 1.0 of the CDDL. # # A full copy of the text of the CDDL should have accompanied this # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # # Copyright (c) 2013 Joyent, Inc. All rights reserved. # # # Lookup a type that is inside a.out. # if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>' exit 2 fi dtrace=$1 t="season_7_lisa_the_vegetrian_t *" exe="tst.aouttype.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -ne 0 ]]; then echo "CTF does not exist in $exe, that's a bug" >&2 exit 1 fi ./$exe & pid=$! rc=`$dtrace -n "BEGIN{ trace((pid$pid\`$t)0); exit(0); }"` kill -9 $pid exit $rc Index: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.ksh =================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.ksh (revision 271692) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.ksh (revision 271693) @@ -1,76 +1,76 @@ #! /usr/bin/ksh # # # This file and its contents are supplied under the terms of the # Common Development and Distribution License ("CDDL"), version 1.0. # You may only use this file in accordance with the terms of version # 1.0 of the CDDL. # # A full copy of the text of the CDDL should have accompanied this # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # # Copyright (c) 2013 Joyent, Inc. All rights reserved. # # # This test is checking that we can read members and that pointers inside # members point to valid data that is intelligible, eg. strings. # if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>' exit 2 fi dtrace=$1 t="zelda_info_t" exe="tst.chasestrings.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -ne 0 ]]; then echo "CTF does not exist in $exe, that's a bug" >&2 exit 1 fi ./$exe & pid=$! $dtrace -qs /dev/stdin <t = (pid$pid\`$t *)(copyin(arg0, sizeof (pid$pid\`$t))); printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n", copyinstr((uintptr_t)this->t->zi_gamename), this->t->zi_ndungeons, copyinstr((uintptr_t)this->t->zi_villain), this->t->zi_haszelda); next = 1; } pid$pid::has_dungeons:entry /next == 1/ { this->t = (pid$pid\`$t *)(copyin(arg0, sizeof (pid$pid\`$t))); printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n", copyinstr((uintptr_t)this->t->zi_gamename), this->t->zi_ndungeons, copyinstr((uintptr_t)this->t->zi_villain), this->t->zi_haszelda); next = 2; } pid$pid::has_villain:entry /next == 2/ { this->t = (pid$pid\`$t *)(copyin(arg0, sizeof (pid$pid\`$t))); printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n", copyinstr((uintptr_t)this->t->zi_gamename), this->t->zi_ndungeons, copyinstr((uintptr_t)this->t->zi_villain), this->t->zi_haszelda); exit(0); } EOF rc=$? kill -9 $pid exit $rc Index: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.libtype.ksh =================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.libtype.ksh (revision 271692) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.libtype.ksh (revision 271693) @@ -1,45 +1,45 @@ #! /usr/bin/ksh # # # This file and its contents are supplied under the terms of the # Common Development and Distribution License ("CDDL"), version 1.0. # You may only use this file in accordance with the terms of version # 1.0 of the CDDL. # # A full copy of the text of the CDDL should have accompanied this # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # # Copyright (c) 2013 Joyent, Inc. All rights reserved. # # # Here we want to make sure that the program in question does not have ctf data # in its a.out; however, we can get types out of a linked libc. # if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>' exit 2 fi dtrace=$1 t="int" exe="tst.libtype.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -eq 0 ]]; then echo "CTF exists in $exe, that's a bug" >&2 exit 1 fi ./$exe & pid=$! rc=`$dtrace -n "BEGIN{ trace((pid$pid\`$t)0); exit(0); }"` kill -9 $pid exit $rc Index: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.pidprint.ksh =================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.pidprint.ksh (revision 271692) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.pidprint.ksh (revision 271693) @@ -1,69 +1,69 @@ #! /usr/bin/ksh # # # This file and its contents are supplied under the terms of the # Common Development and Distribution License ("CDDL"), version 1.0. # You may only use this file in accordance with the terms of version # 1.0 of the CDDL. # # A full copy of the text of the CDDL should have accompanied this # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # # Copyright (c) 2013 Joyent, Inc. All rights reserved. # # # Use print() on userland CTF types and verify we get the data we expect. # if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>' exit 2 fi dtrace=$1 t="final_fantasy_info_t" exe="tst.printtype.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -ne 0 ]]; then echo "CTF does not exist in $exe, that's a bug" >&2 exit 1 fi ./$exe & pid=$! $dtrace -qs /dev/stdin <' exit 2 fi dtrace=$1 t="final_fantasy_info_t" exe="tst.printtype.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -ne 0 ]]; then echo "CTF does not exist in $exe, that's a bug" >&2 exit 1 fi ./$exe & pid=$! $dtrace -p $pid -qs /dev/stdin <' exit 2 fi dtrace=$1 t="final_fantasy_info_t" exe="tst.printtype.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -ne 0 ]]; then echo "CTF does not exist in $exe, that's a bug" >&2 exit 1 fi ./$exe & pid=$! $dtrace -qs /dev/stdin <' exit 2 fi dtrace=$1 t="final_fantasy_info_t" exe="tst.printtype.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -ne 0 ]]; then echo "CTF does not exist in $exe, that's a bug" >&2 exit 1 fi ./$exe & pid=$! $dtrace -p $pid -qs /dev/stdin <' exit 2 fi dtrace=$1 t="zelda_info_t" exe="tst.chasestrings.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -ne 0 ]]; then echo "CTF does not exist in $exe, that's a bug" >&2 exit 1 fi ./$exe & pid=$! $dtrace -32 -qs /dev/stdin <t = (userland info_t *)arg0; printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n", stringof(this->t->zi_gamename), this->t->zi_ndungeons, stringof(this->t->zi_villain), this->t->zi_haszelda); next = 1; } pid$pid::has_dungeons:entry /next == 1/ { this->t = (userland info_t *)arg0; printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n", stringof(this->t->zi_gamename), this->t->zi_ndungeons, stringof(this->t->zi_villain), this->t->zi_haszelda); next = 2; } pid$pid::has_villain:entry /next == 2/ { this->t = (userland info_t *)arg0; printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n", stringof(this->t->zi_gamename), this->t->zi_ndungeons, stringof(this->t->zi_villain), this->t->zi_haszelda); exit(0); } EOF rc=$? kill -9 $pid exit $rc Index: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userstrings.ksh =================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userstrings.ksh (revision 271692) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userstrings.ksh (revision 271693) @@ -1,72 +1,72 @@ #! /usr/bin/ksh # # # This file and its contents are supplied under the terms of the # Common Development and Distribution License ("CDDL"), version 1.0. # You may only use this file in accordance with the terms of version # 1.0 of the CDDL. # # A full copy of the text of the CDDL should have accompanied this # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # # Copyright (c) 2013 Joyent, Inc. All rights reserved. # # # This test is checking that we can read members and that pointers inside # members point to valid data that is intelligible, eg. strings. # if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>' exit 2 fi dtrace=$1 exe="tst.chasestrings.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -ne 0 ]]; then echo "CTF does not exist in $exe, that's a bug" >&2 exit 1 fi ./$exe & pid=$! $dtrace -qs /dev/stdin <zi_gamename), args[0]->zi_ndungeons, stringof(args[0]->zi_villain), args[0]->zi_haszelda); next = 1; } pid$pid::has_dungeons:entry /next == 1/ { printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n", stringof(args[0]->zi_gamename), args[0]->zi_ndungeons, stringof(args[0]->zi_villain), args[0]->zi_haszelda); next = 2; } pid$pid::has_villain:entry /next == 2/ { printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n", stringof(args[0]->zi_gamename), args[0]->zi_ndungeons, stringof(args[0]->zi_villain), args[0]->zi_haszelda); exit(0); } EOF rc=$? kill -9 $pid exit $rc