[Top] [Prev] [Next] [Bottom]


[Contents] [Index]

stack - examine call stack

bind '#p' /prog
stack [-v] pid

Description

For programs compiled with the -g flag (to generate a file that contains debugging information), the stack command decodes the stack traceback information contained in the file /prog/<pid>/stack for the process pid.

Option
-v The verbose option causes stack to print out more information about arguments and variables.

Example

The #p device has been bound to /prog; an examination of the stack file for pid 1 (a shell) reveals:

$ 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.dis

Using 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, 28

In 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] "$ "
$

Files

/prog/pid/status

See Also

ps - thread status
prog - interface to running programs in Chapter 2


[Top] [Prev] [Next] [Bottom]

infernosupport@lucent.com
Copyright © 1997, Lucent Technologies, Inc.. All rights reserved.