1#!/usr/bin/ksh 2# 3# This file and its contents are supplied under the terms of the 4# Common Development and Distribution License ("CDDL"), version 1.0. 5# You may only use this file in accordance with the terms of version 6# 1.0 of the CDDL. 7# 8# A full copy of the text of the CDDL should have accompanied this 9# source. A copy of the CDDL is also available via the Internet at 10# http://www.illumos.org/license/CDDL. 11# 12 13# 14# Copyright 2025 Oxide Computer Company 15# 16 17# 18# Verify that we can reasonably print and walk various anonymous unions and 19# structs. 20# 21 22if (( $# != 1 )); then 23 printf "%s\n" "expected one argument: <dtrace-path>" >&2 24 exit 2 25fi 26 27dtrace=$1 28$dtrace -c ./tst.anon.exe -qs /dev/stdin <<EOF 29pid\$target::mandos:entry 30{ 31 print(*args[0]); 32 printf("\n"); 33 print(args[0]->turgon); 34 print(args[0]->balrog); 35 print(args[0]->elrond); 36 print(args[0]->silmaril); 37 print(*(userland struct pid\`elves *)arg0); 38 printf("\n"); 39 printf("feanor: 0x%x\n", args[0]->feanor); 40 printf("fingolfin: 0x%x\n", args[0]->fingolfin); 41 printf("maedhros: 0x%x\n", args[0]->maedhros); 42 printf("aredhel: 0x%x\n", args[0]->maedhros); 43 printf("fingon: 0x%x\n", args[0]->fingon); 44 printf("turgon: 0x%x\n", args[0]->turgon); 45 printf("tuor: 0x%x\n", args[0]->tuor); 46 printf("idril: 0x%x\n", args[0]->idril); 47 printf("earendil: 0x%x\n", args[0]->earendil); 48 printf("elwing: 0x%x\n", args[0]->elwing); 49 printf("silamril: 0x%x\n", args[0]->silmaril); 50 printf("maeglin: 0x%x\n", args[0]->maeglin); 51 printf("morgoth: 0x%x\n", args[0]->morgoth); 52 printf("balrog: 0x%x\n", args[0]->balrog); 53 printf("gondolin: 0x%x\n", args[0]->gondolin); 54 printf("glorfindel: 0x%x\n", args[0]->glorfindel); 55 printf("elrond: 0x%x\n", args[0]->elrond); 56 printf("elros: 0x%x\n", args[0]->elros); 57 exit(0); 58} 59EOF 60