forsyth20100802-1449bb97c0016 years agoHistory
166 lines · 3.0 KB · Text
RawDownload
.TH STACK 1.SH NAMEstack, stackv \- examine call stack.SH SYNOPSIS.B "bind '#p' /prog".br.B stack[.B -v][.B -p.I dispath.I sblpath]....I pid.br.B stackv[.B -Tlm] [.B -r.I maxdepth] [.I pid\fR[\f5.\fIsym\fR] ...] ....SH DESCRIPTION.I Stackwrites to the standard output a stack trace for process.IR pid ,bydecoding the stack traceback data contained in the file.BI /prog/ pid /stack .The.B -voption causes.I stackto print values of arguments and variables.The output is most useful when the Limbo programwas compiled with the.B -goption to produce a.B .sblsymbol file..PP.I Stackhas a built-in list of associations between.B disdirectories and their associated source directories(e.g. it can automatically map from.B /dis/ls.disto.BR /appl/cmd/ls.sbl ).Giving the.B -poption adds a new association to the head of this list:if a module path prefix matches.IR dispath ,.I stackwill search for a symbol file in.IR sblpath .If the environment variable.B $sblpathis set, pairs of items from it are added to theassociation list, as given as.B -poptions.The.B -poptions take precedence over.BR $sblpath ..PP.I Stackvrecursively traverses the symbols it finds, printingvalues as it goes. Repeated identical structure is notshown \- only the pointer value is printed, followed by.BR (qv) .Each argument gives a starting pointfor the traversal, rooted by a process id,.IR pid .If an unadorned process id is given, all values in allstack frames in the process will be printed; adding namesspecifies the starting point. For instance,.B 123.init.ctxt.displaymight specify the.B displayfield inside the.B ctxtadt inside the.B initfunction inside the process.BR 123 ..I Stackvunderstands the following options:.TP 10.B -lShow source line information with each item..TP.B -mShow module variables accessible from each stack frame..TP.B -TDo not show the Limbo types of value encountered..TP.BI -r \ maxdepthRestrict the maximum traversal depth to.I maxdepthlevels..SH EXAMPLERun.I stackon process with ID 1:.IP.EX$ stack 1unknown fn() Module $Sys PC 742103waitfor() shnew.b:105.7, 38runpipeline() shnew.b:483.2, 14runit() shnew.b:552.3, 29init() shnew.b:83.3, 28.EE.PPThe process is executing in the.B Sysmodule, a call to.B sys->readthat originated at line 105 (characters 7 to 38) of the.B waitforfunction in.BR shnew.b ..PPOnce again, with the.B -voption to reveal more:.IP.EX$ stack -v 1unknown fn() Module $Sys PC 742103waitfor(pid=18) shnew.b:105.7, 38        status=[0] ""        buf=[64] @b419a4        n=-1        who=-1runpipeline(ctx=nil, pipeline=@b41454) shnew.b:483.2, 14        pid=18runit(ctx=nil, pipes=nil) shnew.b:552.3, 29        pipeline=@b41454init(ctxt=nil, argv=nil) shnew.b:83.3, 28        buf=[1024] @b40f04        n=4        arg=@b41634        prompt=[21] "$ "$.EE.SH FILES.BI /prog/ pid /stack.br.BI /prog/ pid /status.SH SOURCE.B /appl/cmd/stack.b.br.B /appl/cmd/stackv.b.SH "SEE ALSO".IR deb (1),.IR ps (1),.IR prog (3),.IR debug (2)