Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ (1) — Plan9 3rd Edition (Vita Nuova)

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ps(1)

prog(3)

debug(2)

STACK(1)

NAME

stack − examine call stack

SYNOPSIS

­bind ’#p’ /prog
­stack [ ­-v ] ­pid

DESCRIPTION

­Stack writes to the standard output a stack trace for process pid, by decoding the stack traceback data contained in the file /prog/pid/stack.  The ­-v option causes ­stack to print values of arguments and variables.  The output is most useful when the Limbo program was compiled with the ­-g option to produce a ­.sbl symbol file. 

EXAMPLE

Run ­stack on process with ID 1:

$ 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

The process is executing in the ­Sys module, a call to ­sys->read that originated at line 105 (characters 7 to 38) of the ­waitfor function in shnew.b. 

Once again, with the ­-v option to reveal more:

$ 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/stack
/prog/pid/status

SOURCE

­/appl/cmd/stack.b

SEE ALSO

ps(1), prog(3), debug(2)

BUGS

Attempts to find a ­.sbl file are only as good as debug->stdsym’s attempts at doing so. 

Plan 9  —  June 29, 2000

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026