aboutsummaryrefslogtreecommitdiff
path: root/doc/srcfiles.1
blob: 6149c21bb805e2cdd0f034d8871a41694a6c703c (plain)
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
.\" Copyright 2023 Red Hat Inc.
.\" Mon 2023-Sept 23 Housam Alamour <halamour@redhat.com>
.\" Contact elfutils-devel@sourceware.org to correct errors or typos.
.TH EU-SRCFILES 1 "2023-Sept-25" "elfutils"

.de SAMPLE
.br
.RS 0
.nf
.nh
\fB
..
.de ESAMPLE
\fP
.hy
.fi
.RE
..

.SH "NAME"
eu-srcfiles \- Lists the source files of a DWARF/ELF file.

.SH "SYNOPSIS"
eu-srcfiles [\fB\-0\fR|\fB\-\-null\fR] [\fB\-c\fR|\fB\-\-cu\-only\fR] [\fB\-v\fR|\fB\-\-verbose\fR] INPUT

.SH "DESCRIPTION"
\fBeu-srcfiles\fR lists the source files of a given \s-DWARF/ELF\s0
file.  This list is based on a search of the DWARF debuginfo, which
may be automatically fetched by debuginfod if applicable.  The target
file may be an executable, a coredump, a process, or even the running
kernel.  The default is the file 'a.out'.  The source file names are
made unique and printed to standard output.

.SH "INPUT OPTIONS"
The long and short forms of options, shown here as alternatives, are
equivalent.
.TP
\fB--core=COREFILE\fR
Find addresses from signatures found in COREFILE.

.TP
\fB--debuginfo-path=PATH\fR
Search path for separate debuginfo files.

.TP
\fB-e FILE\fR, \fB--executable=FILE\fR
Find addresses in FILE.

.TP
\fB-k\fR, \fB--kernel\fR
Find addresses in the running kernel.

.TP
\fB-K\fR, \fB--offline-kernel[=RELEASE]\fR
Kernel with all modules.

.TP
\fB-M FILE\fR, \fB--linux-process-map=FILE\fR
Find addresses in files mapped as read from FILE in Linux /proc/PID/maps format.

.TP
\fB-p PID\fR, \fB--pid=PID\fR
Find addresses in files mapped into process PID.

.TP
\fB-?\fR, \fB--help\fR
Give this help list.

.TP
\fB--usage\fR
Give a short usage message.

.TP
\fB-V\fR, \fB--version\fR
Print program version.

.SH "OUTPUT OPTIONS"

.TP
\fB\-0, \-\-null\fR
Separate items by a null instead of a newline.

.TP
\fB\-c, \-\-cu\-only\fR
Only list the CU names.

.TP
\fB\-v, \-\-verbose\fR
Increase verbosity of logging messages.


.SH EXAMPLES

List all source files for a binary.
.SAMPLE
eu-srcfiles -e /bin/ls
.ESAMPLE

List all compilation units (CU) names for a given process (including shared libraries).
.SAMPLE
eu-srcfiles -c -p $$
.ESAMPLE

List source files of a binary based on its buildid, using debuginfod.
.SAMPLE
binary=`debuginfod-find executable 9c22d8d9e42bd051ffdc1064fdfd456ba781c629`
eu-srcfiles -c -e $binary
.ESAMPLE

Show the source code of the first CU of a shared library.
.SAMPLE
binary=/usr/lib64/libc.so.6
srcfile=`eu-srcfiles -c -e $binary | head -1`
cat `debuginfod-find source $binary $srcfile`
.ESAMPLE

List the source files of a kernel image.
.SAMPLE
eu-srcfiles -e /boot/vmlinuz-`uname -r`
.ESAMPLE


.SH "AUTHOR"
Written by Housam Alamour.

.SH "REPORTING BUGS"
Please reports bugs at https://sourceware.org/bugzilla/

.SH "COPYRIGHT"
Copyright (c) 2023 Red Hat Inc.  License GPLv3+: GNU GPL version 3 or
later <https://gnu.org/licenses/gpl.html>.  This is free software: you
are free to change and redistribute it.  There is NO WARRANTY, to the
extent permitted by law.