bind '#p' /prog stack [-v] pid
-v | The verbose option causes stack to print out more information about arguments and variables. |
$ cat /prog/1/stack 0087ca28 000b52d7 00b40034 00000000 0 $Sys 0087c9e8 00000061 00b40134 0087dd88 0 /dis/sh.dis 0087c9b0 00000289 00b40134 0087dd88 0 /dis/sh.dis 0087c980 000002f2 00b40134 0087dd88 0 /dis/sh.dis 0087c938 0000004e 00b40134 0087dd88 0 /dis/sh.disUsing the stack command on the same process reveals more information. The innermost call is in the System module is a call to sys->read that originated in the waitfor function at line 105 (characters 7 to 38) of shnew.b.
$ stack 1 unknown fn() Module $Sys PC 742103 waitfor() shnew.b:105.7, 38 runpipeline() shnew.b:483.2, 14 runit() shnew.b:552.3, 29 init() shnew.b:83.3, 28In this example, the verbose option to stack provides even more information about the call stack of the process.
$ stack -v 1 unknown fn() Module $Sys PC 742103 waitfor(pid=18) shnew.b:105.7, 38 status=[0] "" buf=[64] @b419a4 n=-1 who=-1 runpipeline(ctx=nil, pipeline=@b41454) shnew.b:483.2, 14 pid=18 runit(ctx=nil, pipes=nil) shnew.b:552.3, 29 pipeline=@b41454 init(ctxt=nil, argv=nil) shnew.b:83.3, 28 buf=[1024] @b40f04 n=4 arg=@b41634 prompt=[21] "$ " $