tst.aouttype.ksh revision 266989
1193323Sed#! /usr/bin/ksh
2193323Sed#
3193323Sed#
4193323Sed# This file and its contents are supplied under the terms of the
5193323Sed# Common Development and Distribution License ("CDDL"), version 1.0.
6193323Sed# You may only use this file in accordance with the terms of version
7193323Sed# 1.0 of the CDDL.
8193323Sed#
9193323Sed# A full copy of the text of the CDDL should have accompanied this
10193323Sed# source.  A copy of the CDDL is also available via the Internet at
11193323Sed# http://www.illumos.org/license/CDDL.
12193323Sed#
13193323Sed
14193323Sed#
15193323Sed# Copyright (c) 2013 Joyent, Inc. All rights reserved.
16193323Sed#
17193323Sed
18195098Sed#
19193323Sed# Lookup a type that is inside a.out.
20193323Sed#
21193323Sed
22198090Srdivackyif [ $# != 1 ]; then
23198090Srdivacky        echo expected one argument: '<'dtrace-path'>'
24198090Srdivacky        exit 2
25198090Srdivackyfi
26193323Sed
27195098Seddtrace=$1
28193323Sedt="season_7_lisa_the_vegetrian_t *"
29193323Sedexe="tst.aouttype.exe"
30193323Sed
31193323Sedelfdump "./$exe" | grep -q '.SUNW_ctf' 
32193323Sedif [[ $? -ne 0 ]]; then
33193323Sed	echo "CTF does not exist in $exe, that's a bug" >&2
34193323Sed	exit 1
35193323Sedfi
36193323Sed
37193323Sed./$exe &
38193323Sedpid=$!
39193323Sed
40193323Sedrc=`$dtrace -n "BEGIN{ trace((pid$pid\`$t)0); exit(0); }"`
41193323Sed
42195098Sedkill -9 $pid
43193323Sed
44193323Sedexit $rc
45193323Sed