xref: /netbsd-src/external/gpl3/binutils/dist/gprofng/doc/gp-display-src.texi (revision cb63e24e8d6aae7ddac1859a9015f48b1d8bd90e)
1*cb63e24eSchristos@c ----------------------------------------------------------------------------
2*cb63e24eSchristos@c This is the Texinfo source file for the gp-display-src man page.
3*cb63e24eSchristos@c
4*cb63e24eSchristos@c Author: Ruud van der Pas
5*cb63e24eSchristos@c ----------------------------------------------------------------------------
6*cb63e24eSchristos@ifset man
7*cb63e24eSchristos\input texinfo @c -*-texinfo-*-
8*cb63e24eSchristos@setfilename gp-display-src
9*cb63e24eSchristos@settitle Display source code and optionally disassembly of the target object
10*cb63e24eSchristos@include gp-macros.texi
11*cb63e24eSchristos@end ifset
12*cb63e24eSchristos
13*cb63e24eSchristos@c ----------------------------------------------------------------------------
14*cb63e24eSchristos@c This is from the man-pages(7) man page
15*cb63e24eSchristos@c
16*cb63e24eSchristos@c "The list below shows conventional or suggested sections.  Most manual pages
17*cb63e24eSchristos@c  should include at least the highlighted sections.  Arrange a new manual
18*cb63e24eSchristos@c  page so that sections are placed in the order shown in the list."
19*cb63e24eSchristos@c
20*cb63e24eSchristos@c              NAME
21*cb63e24eSchristos@c              SYNOPSIS
22*cb63e24eSchristos@c              CONFIGURATION    [Normally only in Section 4]
23*cb63e24eSchristos@c              DESCRIPTION
24*cb63e24eSchristos@c              OPTIONS          [Normally only in Sections 1, 8]
25*cb63e24eSchristos@c              EXIT STATUS      [Normally only in Sections 1, 8]
26*cb63e24eSchristos@c              RETURN VALUE     [Normally only in Sections 2, 3]
27*cb63e24eSchristos@c              ERRORS           [Typically only in Sections 2, 3]
28*cb63e24eSchristos@c              ENVIRONMENT
29*cb63e24eSchristos@c              FILES
30*cb63e24eSchristos@c              VERSIONS         [Normally only in Sections 2, 3]
31*cb63e24eSchristos@c              ATTRIBUTES       [Normally only in Sections 2, 3]
32*cb63e24eSchristos@c              CONFORMING TO
33*cb63e24eSchristos@c              NOTES
34*cb63e24eSchristos@c              BUGS
35*cb63e24eSchristos@c              EXAMPLES
36*cb63e24eSchristos@c              AUTHORS          [Discouraged]
37*cb63e24eSchristos@c              REPORTING BUGS   [Not used in man-pages]
38*cb63e24eSchristos@c              COPYRIGHT        [Not used in man-pages]
39*cb63e24eSchristos@c              SEE ALSO
40*cb63e24eSchristos@c
41*cb63e24eSchristos@c This is what the texi2pod.pl tool recognizes:
42*cb63e24eSchristos@c
43*cb63e24eSchristos@c for $sect (qw(NAME SYNOPSIS TARGET DESCRIPTION OPTIONS ENVIRONMENT FILES
44*cb63e24eSchristos@c               BUGS NOTES FOOTNOTES SEEALSO AUTHOR COPYRIGHT)) {
45*cb63e24eSchristos@c
46*cb63e24eSchristos@c What is interesting is that it places "SEE ALSO" before "COPYRIGHT", which
47*cb63e24eSchristos@c makes sense and adhered to for the other formats.
48*cb63e24eSchristos@c ----------------------------------------------------------------------------
49*cb63e24eSchristos
50*cb63e24eSchristos@c ----------------------------------------------------------------------------
51*cb63e24eSchristos@c NAME section
52*cb63e24eSchristos@c ----------------------------------------------------------------------------
53*cb63e24eSchristos
54*cb63e24eSchristos@ManPageStart{NAME}
55*cb63e24eSchristos@c man begin NAME
56*cb63e24eSchristos
57*cb63e24eSchristosgp-display-src - Display the source code, optionally interleaved with the
58*cb63e24eSchristosdisassembly of the target object
59*cb63e24eSchristos
60*cb63e24eSchristos@c man end
61*cb63e24eSchristos@ManPageEnd{}
62*cb63e24eSchristos
63*cb63e24eSchristos@c ----------------------------------------------------------------------------
64*cb63e24eSchristos@c SYNOPSIS section
65*cb63e24eSchristos@c ----------------------------------------------------------------------------
66*cb63e24eSchristos
67*cb63e24eSchristos@ManPageStart{SYNOPSIS}
68*cb63e24eSchristos@c man begin SYNOPSIS
69*cb63e24eSchristos
70*cb63e24eSchristos@command{gprofng display src} [@var{option(s)}] @var{target-file}
71*cb63e24eSchristos
72*cb63e24eSchristos@c man end
73*cb63e24eSchristos@ManPageEnd{}
74*cb63e24eSchristos
75*cb63e24eSchristos@c ----------------------------------------------------------------------------
76*cb63e24eSchristos@c DESCRIPTION section
77*cb63e24eSchristos@c ----------------------------------------------------------------------------
78*cb63e24eSchristos
79*cb63e24eSchristos@ManPageStart{DESCRIPTION}
80*cb63e24eSchristos@c man begin DESCRIPTION
81*cb63e24eSchristos
82*cb63e24eSchristosDisplay the source code listing, or source code interleaved with disassembly
83*cb63e24eSchristoscode, as extracted from the target file (an executable, shared object, object
84*cb63e24eSchristosfile, or a Java .class file).
85*cb63e24eSchristos
86*cb63e24eSchristosFor example, this command displays the source code and disassembly listing for
87*cb63e24eSchristosa function called @samp{mxv_core} that is part of object file @samp{mxv.o}:
88*cb63e24eSchristos
89*cb63e24eSchristos@smallexample
90*cb63e24eSchristos$ gprofng display src -disasm mxv_core mxv.o
91*cb63e24eSchristos@end smallexample
92*cb63e24eSchristos
93*cb63e24eSchristosTo list the source code and disassembly for all the functions in this file,
94*cb63e24eSchristosuse the following command:
95*cb63e24eSchristos
96*cb63e24eSchristos@smallexample
97*cb63e24eSchristos$ gprofng display src -disasm all -1 mxv.o
98*cb63e24eSchristos@end smallexample
99*cb63e24eSchristos
100*cb63e24eSchristosThe @var{target-file} is the name of an executable, a shared object, an object
101*cb63e24eSchristosfile (.o), or a Java .class file.
102*cb63e24eSchristos
103*cb63e24eSchristosIf no options are given, the source code listing of the @var{target-file}
104*cb63e24eSchristosis shown.  This is equivalent to @samp{-source all -1}.  If this information
105*cb63e24eSchristosis not available, a message to this extent is printed.
106*cb63e24eSchristos
107*cb63e24eSchristos@c man end
108*cb63e24eSchristos@ManPageEnd{}
109*cb63e24eSchristos
110*cb63e24eSchristos@c ----------------------------------------------------------------------------
111*cb63e24eSchristos@c OPTIONS section
112*cb63e24eSchristos@c ----------------------------------------------------------------------------
113*cb63e24eSchristos
114*cb63e24eSchristos@ManPageStart{OPTIONS}
115*cb63e24eSchristos@c man begin OPTIONS
116*cb63e24eSchristos
117*cb63e24eSchristos@table @gcctabopt
118*cb63e24eSchristos
119*cb63e24eSchristos@item --version
120*cb63e24eSchristos@ifclear man
121*cb63e24eSchristos@IndexSubentry{Options, @code{--version}}
122*cb63e24eSchristos@end ifclear
123*cb63e24eSchristos
124*cb63e24eSchristosPrint the version number and exit.
125*cb63e24eSchristos
126*cb63e24eSchristos@item --help
127*cb63e24eSchristos@ifclear man
128*cb63e24eSchristos@IndexSubentry{Options, @code{--help}}
129*cb63e24eSchristos@end ifclear
130*cb63e24eSchristos
131*cb63e24eSchristosPrint usage information and exit.
132*cb63e24eSchristos
133*cb63e24eSchristos@item -functions
134*cb63e24eSchristos@ifclear man
135*cb63e24eSchristos@IndexSubentry{Options,  @code{-functions}}
136*cb63e24eSchristos@IndexSubentry{Commands, @code{functions}}
137*cb63e24eSchristos@end ifclear
138*cb63e24eSchristosList all the functions from the given object.
139*cb63e24eSchristos
140*cb63e24eSchristos@item -source @var{item} @var{tag}
141*cb63e24eSchristos@ifclear man
142*cb63e24eSchristos@IndexSubentry{Options, @code{-source}}
143*cb63e24eSchristos@IndexSubentry{Commands, @code{source}}
144*cb63e24eSchristos@end ifclear
145*cb63e24eSchristosShow the source code for @var{item} in @var{target-file}.  The @var{tag}
146*cb63e24eSchristosis used to differentiate in case there are multiple occurences with the same
147*cb63e24eSchristosname.
148*cb63e24eSchristosSee the @samp{NOTES} section for the definition of @var{item} and @var{tag}.
149*cb63e24eSchristos
150*cb63e24eSchristos@item -disasm @var{item} @var{tag}
151*cb63e24eSchristos@ifclear man
152*cb63e24eSchristos@IndexSubentry{Options,  @code{-disasm}}
153*cb63e24eSchristos@IndexSubentry{Commands, @code{disasm}}
154*cb63e24eSchristos@end ifclear
155*cb63e24eSchristosInclude the disassembly in the source listing.  The default listing does not
156*cb63e24eSchristosinclude the disassembly.  If the source code is not available, show a listing
157*cb63e24eSchristosof the disassembly only.
158*cb63e24eSchristosSee the @samp{NOTES} section for the definition of @var{item} and @var{tag}.
159*cb63e24eSchristos
160*cb63e24eSchristos@item -outfile @var{filename}
161*cb63e24eSchristos@ifclear man
162*cb63e24eSchristos@IndexSubentry{Options,  @code{-outfile}}
163*cb63e24eSchristos@IndexSubentry{Commands, @code{outfile}}
164*cb63e24eSchristos@end ifclear
165*cb63e24eSchristosWrite results to file @var{filename}.  A dash (@minus{}) writes to stdout.
166*cb63e24eSchristosThis is also the default.  Note that this option only affects those options
167*cb63e24eSchristosincluded to the right of the option.
168*cb63e24eSchristos
169*cb63e24eSchristos@end table
170*cb63e24eSchristos
171*cb63e24eSchristos@c man end
172*cb63e24eSchristos@ManPageEnd{}
173*cb63e24eSchristos
174*cb63e24eSchristos@c ----------------------------------------------------------------------------
175*cb63e24eSchristos@c NOTES section
176*cb63e24eSchristos@c ----------------------------------------------------------------------------
177*cb63e24eSchristos
178*cb63e24eSchristos@ManPageStart{NOTES}
179*cb63e24eSchristos@c man begin NOTES
180*cb63e24eSchristos
181*cb63e24eSchristosUse @var{item} to specify the name of a function, or of a source or object
182*cb63e24eSchristosfile that was used to build the executable, or shared object.
183*cb63e24eSchristos
184*cb63e24eSchristosThe @var{tag} is an index used to determine which item is being referred
185*cb63e24eSchristosto when multiple functions have the same name.  It is required, but will
186*cb63e24eSchristosbe ignored if not necessary to resolve the function.
187*cb63e24eSchristos
188*cb63e24eSchristosThe @var{item} may also be specified in the form @samp{function`file`}, in
189*cb63e24eSchristoswhich case the source or disassembly of the named function in the source
190*cb63e24eSchristoscontext of the named file will be used.
191*cb63e24eSchristos
192*cb63e24eSchristosThe special @var{item} and @var{tag} combination @samp{all -1}, is used to
193*cb63e24eSchristosindicate generating the source, or disassembly, for all functions in the
194*cb63e24eSchristos@var{target-file}.
195*cb63e24eSchristos
196*cb63e24eSchristos@c man end
197*cb63e24eSchristos@ManPageEnd{}
198*cb63e24eSchristos
199*cb63e24eSchristos@c ----------------------------------------------------------------------------
200*cb63e24eSchristos@c SEEALSO section
201*cb63e24eSchristos@c ----------------------------------------------------------------------------
202*cb63e24eSchristos
203*cb63e24eSchristos@ManPageStart{SEE ALSO}
204*cb63e24eSchristos@c man begin SEEALSO
205*cb63e24eSchristos
206*cb63e24eSchristosgprofng(1),
207*cb63e24eSchristosgp-archive(1),
208*cb63e24eSchristosgp-collect-app(1),
209*cb63e24eSchristosgp-display-gui(1),
210*cb63e24eSchristosgp-display-html(1),
211*cb63e24eSchristosgp-display-text(1)
212*cb63e24eSchristos
213*cb63e24eSchristos@iftex
214*cb63e24eSchristos@vspace{1}
215*cb63e24eSchristos@end iftex
216*cb63e24eSchristos
217*cb63e24eSchristosThe user guide for gprofng is maintained as a Texinfo manual.  If the info
218*cb63e24eSchristosand gprofng programs are correctly installed, the command
219*cb63e24eSchristos@command{info gprofng} should give access to this document.
220*cb63e24eSchristos
221*cb63e24eSchristos@c man end
222*cb63e24eSchristos@ManPageEnd{}
223*cb63e24eSchristos
224*cb63e24eSchristos@c ----------------------------------------------------------------------------
225*cb63e24eSchristos@c COPYRIGHT section
226*cb63e24eSchristos@c ----------------------------------------------------------------------------
227*cb63e24eSchristos
228*cb63e24eSchristos@ManPageStart{COPYRIGHT}
229*cb63e24eSchristos@c man begin COPYRIGHT
230*cb63e24eSchristos
231*cb63e24eSchristosCopyright @copyright{} 2022-2024 Free Software Foundation, Inc.
232*cb63e24eSchristos
233*cb63e24eSchristosPermission is granted to copy, distribute and/or modify this document
234*cb63e24eSchristosunder the terms of the GNU Free Documentation License, Version 1.3
235*cb63e24eSchristosor any later version published by the Free Software Foundation;
236*cb63e24eSchristoswith no Invariant Sections, with no Front-Cover Texts, and with no
237*cb63e24eSchristosBack-Cover Texts.  A copy of the license is included in the
238*cb63e24eSchristossection entitled ``GNU Free Documentation License''.
239*cb63e24eSchristos
240*cb63e24eSchristos@c man end
241*cb63e24eSchristos@ManPageEnd{}
242*cb63e24eSchristos
243*cb63e24eSchristos@c ----------------------------------------------------------------------------
244*cb63e24eSchristos@c If this text is used for a man page, exit.  Otherwise we need to continue.
245*cb63e24eSchristos@c ----------------------------------------------------------------------------
246*cb63e24eSchristos
247*cb63e24eSchristos@ifset man
248*cb63e24eSchristos@bye
249*cb63e24eSchristos@end ifset
250