plan9port/bin/stack

18 lines
300 B
Text
Raw Permalink Normal View History

2005-01-23 22:56:33 +00:00
#!/usr/local/plan9/bin/rc
2008-07-10 15:05:34 +00:00
if(~ $#* 0)
pid=core
if not
pid=$1
2006-06-26 00:02:19 +00:00
shift
2008-07-10 15:05:34 +00:00
if(! ~ $pid [0-9] [0-9]*[0-9] */core *.core core.* */core.* core){
2006-06-26 00:02:19 +00:00
name=$pid
pid=`{psu|awk '$NF=="'$name'" {print $2}'}
if(~ $#pid 0){
echo 'stack: no process '$name
exit none
}
}
for(p in $pid)
echo '$c' | 9 db -q $p $*