forked from peadar/pstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pstack.1.txt
96 lines (71 loc) · 3.26 KB
/
pstack.1.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
PSTACK(1) BSD General Commands Manual PSTACK(1)
NAME
pstack — print stack traces of threads in a running process or a core
file
SYNOPSIS
pstack [-a] [-j] [-n] [-p] [-s] [-t] [-v] [-b seconds] [-g directory]
⟨executable | pid | core⟩ *
pstack -d elf-file
pstack -D elf-file
pstack -V
pstack -h
DESCRIPTION
Displays the stack traces of each thread in the running process with
process id pid or from the core file core
Normal invocation prints the stack trace from a core file or running
process. This implementation understands the stack unwinding data in
eh_frame sections, and properly unwinds through stack frames of code com‐
piled with -fomit-frame-pointer and on x86_64
Arguments are as follows.
-a Show values of arguments passed to functions if possible (re‐
quires DWARF debug data for function's code). This also works
in python mode.
-j Use JSON format for the stack output
-n Do not attempt to find external debug information. DWARF de‐
bug information and symbol tables may be contained in sepa‐
rate ELF objects, as referenced by either the .gnu_debuglink
or inferred by the GNU "build ID" ELF note.
-p Attempt to print the stack trace from any discovered python
interpreters and threads. This feature is experimental, and
only works with Python 2.7.
-s Do not attempt to locate source code information (file and
line number) for each frame. Finding the source locations may
slow down stack tracing.
-t Do not use the thread_db library to associate userland thread
data structures with kernel level LWPs. For modern linux sys‐
tems, LWPs and user mode threads are effectively the same
thing. At this point the only benefit of using this library
is to associated pthread IDs with the LWPs.
-v Produce more verbose diagnostics. Can be repeated to increase
verbosity further.
-b N Poll-mode: repeatedly trace stacks every N seconds, until in‐
terrupted.
-g directory
Use directory as a potential location to find debug ELF im‐
ages, as referred to by a build-id note or gnu_debuglink sec‐
tion. The default directory is /usr/lib/debug
⟨executable | core | pid⟩
List of core files or PIDs to trace. An executable image
specified on the command line will override the executable
derived from the core or processes specified after it until a
different executable image is provided
There are some options to aid debugging issues with ELF and DWARF bina‐
ries. Namely
pstack -D ELF-image
Format DWARF debugging information of the provided ELF-image
in JSON
pstack -d ELF-image
Format ELF information of the provided ELF-image in JSON
pstack -V Print git commit-id used to build pstack
pstack -h Print usage synopsis pstack
SEE ALSO
procfs(5) ptrace(2)
TODO
• Support rela for object files
• This actually works on ARM (i.e., raspi), but needs debug_frame. Ap‐
parently, ARM has its own magical sections for storing unwind infor‐
mation that it might be worth implementing.
works on x86_64 and i686 only.
AUTHORS
Peter Edwards <peadar (at) isainmdom dot net>
BSD Mar 29, 2018 BSD