source: general/prog/gdb.xml@ 9ae8a83e

12.0 12.1 kea ken/TL2024 ken/tuningfonts lazarus plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since 9ae8a83e was 11f9b1d1, checked in by Pierre Labastie <pierre.labastie@…>, 13 months ago

Document gdb-add-index in short descriptions

Also reinstate libinproctrace in short descriptions

  • Property mode set to 100644
File size: 11.3 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY gdb-download-http "&gnu-http;/gdb/gdb-&gdb-version;.tar.xz">
8 <!ENTITY gdb-download-ftp "&gnu-ftp;/gdb/gdb-&gdb-version;.tar.xz">
9 <!ENTITY gdb-md5sum "fbd3cdae16c581e8a742cb766ba35076">
10 <!ENTITY gdb-size "23 MB">
11 <!ENTITY gdb-buildsize "914 MB (add 805 MB for docs; add 575 MB for tests)">
12 <!ENTITY gdb-time "2.1 SBU (add 0.4 SBU for docs; add 18 SBU for tests; all using parallelism=4)">
13]>
14
15<sect1 id="gdb" xreflabel="GDB-&gdb-version;">
16 <?dbhtml filename="gdb.html"?>
17
18
19 <title>GDB-&gdb-version;</title>
20
21 <indexterm zone="gdb">
22 <primary sortas="a-GDB">GDB</primary>
23 </indexterm>
24
25 <sect2 role="package">
26 <title>Introduction to GDB</title>
27
28 <para>
29 <application>GDB</application>, the GNU Project debugger, allows you
30 to see what is going on <quote>inside</quote> another program while it
31 executes -- or what another program was doing at the moment it crashed.
32 Note that <application>GDB</application> is most effective when tracing
33 programs and libraries that were built with debugging symbols and not
34 stripped.
35 </para>
36
37 &lfs113_checked;
38
39 <bridgehead renderas="sect3">Package Information</bridgehead>
40 <itemizedlist spacing="compact">
41 <listitem>
42 <para>
43 Download (HTTP): <ulink url="&gdb-download-http;"/>
44 </para>
45 </listitem>
46 <listitem>
47 <para>
48 Download (FTP): <ulink url="&gdb-download-ftp;"/>
49 </para>
50 </listitem>
51 <listitem>
52 <para>
53 Download MD5 sum: &gdb-md5sum;
54 </para>
55 </listitem>
56 <listitem>
57 <para>
58 Download size: &gdb-size;
59 </para>
60 </listitem>
61 <listitem>
62 <para>
63 Estimated disk space required: &gdb-buildsize;
64 </para>
65 </listitem>
66 <listitem>
67 <para>
68 Estimated build time: &gdb-time;
69 </para>
70 </listitem>
71 </itemizedlist>
72 <!--
73 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
74 <itemizedlist spacing="compact">
75 <listitem>
76 <para>
77 Required patch:
78 <ulink url="&patch-root;/gdb-&gdb-version;-upstream_fixes-1.patch"/>
79 </para>
80 </listitem>
81 </itemizedlist>
82 -->
83 <bridgehead renderas="sect3">GDB Dependencies</bridgehead>
84
85 <bridgehead renderas="sect4">Recommended Runtime Dependency</bridgehead>
86 <para role="recommended">
87 <xref linkend="six"/> (Python 3 module, required at run-time to
88 use GDB scripts from various LFS/BLFS packages with Python 3
89 installed in LFS)
90 </para>
91
92 <bridgehead renderas="sect4">Optional</bridgehead>
93 <para role="optional">
94 <xref linkend="doxygen"/>,
95 <xref linkend="gcc"/> (ada, gfortran, and go are used for tests),
96 <xref linkend="guile"/>,
97 <!-- don't advertise python2...
98 <xref linkend="python2"/>,-->
99 <xref linkend="rust"/> (used for some tests),
100 <xref linkend="valgrind"/>, and
101 <ulink url="https://sourceware.org/systemtap/">SystemTap</ulink>
102 (run-time, used for tests)
103 </para>
104
105 <para condition="html" role="usernotes">User Notes:
106 <ulink url="&blfs-wiki;/gdb"/>
107 </para>
108 </sect2>
109
110 <sect2 role="installation">
111 <title>Installation of GDB</title>
112 <!--
113 <para>
114 First, apply a patch that fixes problems when debugging programs compiled
115 with <xref linkend="rust" role="nodep"/>:
116 </para>
117
118<screen><userinput remap="pre">patch -Np1 -i ../gdb-&gdb-version;-upstream_fixes-1.patch</userinput></screen>
119-->
120 <para>
121 Install <application>GDB</application> by running the following
122 commands:
123 </para>
124
125<screen><userinput>mkdir build &amp;&amp;
126cd build &amp;&amp;
127
128../configure --prefix=/usr \
129 --with-system-readline \
130 --with-python=/usr/bin/python3 &amp;&amp;
131make</userinput></screen>
132
133 <para>
134 Optionally, to build the API documentation using
135 <xref linkend="doxygen"/>, run:
136 </para>
137
138<screen remap="doc"><userinput>make -C gdb/doc doxy</userinput></screen>
139
140 <para>
141 To test the results, issue:
142 </para>
143
144<screen remap="test"><userinput>pushd gdb/testsuite &amp;&amp;
145make site.exp &amp;&amp;
146echo "set gdb_test_timeout 120" &gt;&gt; site.exp &amp;&amp;
147runtest
148popd</userinput></screen>
149
150 <para>
151 See <emphasis>gdb/testsuite/README</emphasis> and <ulink
152 url="https://sourceware.org/gdb/wiki/TestingGDB">TestingGDB</ulink>.
153 There are many problems with the test suite:
154 </para>
155
156 <itemizedlist>
157 <listitem>
158 <para>
159 Clean directories are needed if re-running the tests. For that
160 reason, make a copy of the compiled source code
161 directory before the tests in case you need to run the tests again.
162 </para>
163 </listitem>
164
165 <listitem>
166 <para>
167 Results depend on installed compilers.
168 </para>
169 </listitem>
170<!-- I did not see this
171 <listitem>
172 <para>
173 There are a large number of timeouts (there is a variable
174 that can be set to increase time for timeout, but
175 changing it will result in a different number of tests being
176 run).
177 </para>
178 </listitem>
179or this
180 <listitem>
181 <para>
182 There are failures associated with system readline 6.x.
183 </para>
184 </listitem>
185-->
186<!--
187 <listitem>
188 <para>
189 A few tests assume that the header file
190 <filename>&lt;sys/sdt.h&gt;</filename>, part of <ulink
191 url="https://sourceware.org/systemtap/">SystemTap</ulink>, is
192 present.
193 </para>
194 </listitem>
195-->
196<!-- I don't know if this is true or not. I tested on a Haswell.
197 <listitem>
198 <para>
199 If the test suite is run on a Skylake-based Intel CPU or newer,
200 many tests will fail due to the removal of the deprecated/problematic
201 libmpx library in GCC.
202 </para>
203 </listitem>
204-->
205 <listitem>
206 <para>
207<!-- for gdb-11.1, gcc-11.2 - pierre
208 A test run of the test suite had about 1700 unexpected failures
209 (out of over 80000 tests). Over 1370 of the failures were related
210 to FORTRAN tests. -->
211<!-- for gdb-12.1, gcc-11.3.0 - bdubbs
212 A test run of the test suite had a little over 200 unexpected failures
213 out of over 94000 tests.-->
214<!-- for gdb-13.0, gcc-12.2.0 - bdubbs
215 A test run of the test suite had 33 unexpected failures
216 out of over 106000 tests. -->
217<!-- for gdb-13.2, gcc-13.1.0 - pierre -->
218 A test run of the test suite had 183 unexpected failures
219 out of over 105000 tests.
220 </para>
221 </listitem>
222
223 <listitem>
224 <para>
225 On some systems, the gdb.tui test suite will fail if running over
226 SSH.
227 </para>
228 </listitem>
229
230 <listitem>
231 <para>
232 On some AMD-based systems, over 200 additional tests
233 may fail due to a difference in the threading implementation
234 on those CPUs.
235 </para>
236 </listitem>
237
238 </itemizedlist>
239
240 <para>
241 Now, as the <systemitem class="username">root</systemitem> user:
242 </para>
243
244<screen role="root"><userinput>make -C gdb install &amp;&amp;
245make -C gdbserver install</userinput></screen>
246
247 <para>
248 If you have built the API documentation, it is now in gdb/doc/doxy.
249 You can install it (as the <systemitem class="username">root</systemitem>
250 user):
251 </para>
252
253<screen role="root"
254 remap="doc"><userinput>install -d /usr/share/doc/gdb-&gdb-version; &amp;&amp;
255rm -rf gdb/doc/doxy/xml &amp;&amp;
256cp -Rv gdb/doc/doxy /usr/share/doc/gdb-&gdb-version;</userinput></screen>
257
258 </sect2>
259
260 <sect2 role="commands">
261 <title>Command Explanations</title>
262
263 <para>
264 <parameter>--with-system-readline</parameter>: This switch forces
265 <application>GDB</application> to use the copy of
266 <application>Readline</application> installed in LFS.
267 </para>
268
269 <para>
270 <parameter>--with-python=/usr/bin/python3</parameter>: This switch
271 forces <application>GDB</application> to use Python 3.
272 <!-- We don't advise to use python2 anymore
273 Remove this switch if you have installed
274 <xref linkend="python2"/> and want to use it instead of Python 3.-->
275 </para>
276
277 </sect2>
278
279 <sect2 role="content">
280 <title>Contents</title>
281
282 <segmentedlist>
283 <segtitle>Installed Programs</segtitle>
284 <segtitle>Installed Library</segtitle>
285 <segtitle>Installed Directories</segtitle>
286
287 <seglistitem>
288 <seg>
289 gcore, gdb, gdbserver, and gdb-add-index
290 </seg>
291 <seg>
292 libinproctrace.so
293 </seg>
294 <seg>
295 /usr/{include,share}/gdb and /usr/share/doc/gdb-&gdb-version;
296 </seg>
297 </seglistitem>
298 </segmentedlist>
299
300 <variablelist>
301 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
302 <?dbfo list-presentation="list"?>
303 <?dbhtml list-presentation="table"?>
304
305 <varlistentry id="gcore">
306 <term><command>gcore</command></term>
307 <listitem>
308 <para>
309 generates a core dump of a running program
310 </para>
311 <indexterm zone="gdb gcore">
312 <primary sortas="b-gcore">gcore</primary>
313 </indexterm>
314 </listitem>
315 </varlistentry>
316
317 <varlistentry id="gdb-prog">
318 <term><command>gdb</command></term>
319 <listitem>
320 <para>
321 is the GNU Debugger
322 </para>
323 <indexterm zone="gdb gdb-prog">
324 <primary sortas="b-gdb-prog">gdb-prog</primary>
325 </indexterm>
326 </listitem>
327 </varlistentry>
328
329 <varlistentry id="gdbserver">
330 <term><command>gdbserver</command></term>
331 <listitem>
332 <para>
333 is a remote server for the GNU debugger (it allows programs
334 to be debugged from a different machine)
335 </para>
336 <indexterm zone="gdb gdbserver">
337 <primary sortas="b-gdbserver">gdbserver</primary>
338 </indexterm>
339 </listitem>
340 </varlistentry>
341
342 <varlistentry id="gdb-add-index">
343 <term><command>gdb-add-index</command></term>
344 <listitem>
345 <para>
346 Allows adding index files to ELF binaries. This speeds up
347 <command>gdb</command> start on large programs.
348 </para>
349 <indexterm zone="gdb gdb-add-index">
350 <primary sortas="b-gdb-add-index">gdb-add-index</primary>
351 </indexterm>
352 </listitem>
353 </varlistentry>
354
355 <varlistentry id="libinproctrace">
356 <term><filename class="libraryfile">libinproctrace.so</filename></term>
357 <listitem>
358 <para>
359 contains functions for the in-process tracing agent. The agent
360 allows for installing fast tracepoints, listing static tracepoint
361 markers, probing static tracepoints markers, and starting trace
362 monitoring.
363 </para>
364 <indexterm zone="gdb libinproctrace">
365 <primary sortas="c-libinproctrace">libinproctrace.so</primary>
366 </indexterm>
367 </listitem>
368 </varlistentry>
369
370 </variablelist>
371
372 </sect2>
373
374</sect1>
Note: See TracBrowser for help on using the repository browser.