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

12.0 12.1 gimp3 kea ken/TL2024 ken/tuningfonts lazarus lxqt plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since 9fd586e9 was 11f9b1d1, checked in by Pierre Labastie <pierre.labastie@…>, 14 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
RevLine 
[4b0ebf70]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
[8dfc5c3]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">
[da73c1c]9 <!ENTITY gdb-md5sum "fbd3cdae16c581e8a742cb766ba35076">
[6f0a8c86]10 <!ENTITY gdb-size "23 MB">
[da73c1c]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)">
[4b0ebf70]13]>
14
[d3970e1]15<sect1 id="gdb" xreflabel="GDB-&gdb-version;">
[4b0ebf70]16 <?dbhtml filename="gdb.html"?>
17
18
[d3970e1]19 <title>GDB-&gdb-version;</title>
[4b0ebf70]20
21 <indexterm zone="gdb">
[4890200]22 <primary sortas="a-GDB">GDB</primary>
[4b0ebf70]23 </indexterm>
24
25 <sect2 role="package">
[d3970e1]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>
[4b0ebf70]36
[9c87711]37 &lfs113_checked;
[4b0ebf70]38
39 <bridgehead renderas="sect3">Package Information</bridgehead>
40 <itemizedlist spacing="compact">
41 <listitem>
[4890200]42 <para>
43 Download (HTTP): <ulink url="&gdb-download-http;"/>
44 </para>
[4b0ebf70]45 </listitem>
46 <listitem>
[4890200]47 <para>
48 Download (FTP): <ulink url="&gdb-download-ftp;"/>
49 </para>
[4b0ebf70]50 </listitem>
51 <listitem>
[4890200]52 <para>
53 Download MD5 sum: &gdb-md5sum;
54 </para>
[4b0ebf70]55 </listitem>
56 <listitem>
[4890200]57 <para>
58 Download size: &gdb-size;
59 </para>
[4b0ebf70]60 </listitem>
61 <listitem>
[4890200]62 <para>
63 Estimated disk space required: &gdb-buildsize;
64 </para>
[4b0ebf70]65 </listitem>
66 <listitem>
[4890200]67 <para>
68 Estimated build time: &gdb-time;
69 </para>
[4b0ebf70]70 </listitem>
71 </itemizedlist>
[da73c1c]72 <!--
[17817c8]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>
[da73c1c]82 -->
[d3970e1]83 <bridgehead renderas="sect3">GDB Dependencies</bridgehead>
[d4c9b7c]84
[9533795]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
[d4c9b7c]92 <bridgehead renderas="sect4">Optional</bridgehead>
93 <para role="optional">
[852fc810]94 <xref linkend="doxygen"/>,
[a2e21ee]95 <xref linkend="gcc"/> (ada, gfortran, and go are used for tests),
[51cb7cd]96 <xref linkend="guile"/>,
[da73c1c]97 <!-- don't advertise python2...
98 <xref linkend="python2"/>,-->
[51cb7cd]99 <xref linkend="rust"/> (used for some tests),
[2029b72]100 <xref linkend="valgrind"/>, and
101 <ulink url="https://sourceware.org/systemtap/">SystemTap</ulink>
[51cb7cd]102 (run-time, used for tests)
[d4c9b7c]103 </para>
104
[4b0ebf70]105 <para condition="html" role="usernotes">User Notes:
[d3970e1]106 <ulink url="&blfs-wiki;/gdb"/>
107 </para>
[4b0ebf70]108 </sect2>
109
110 <sect2 role="installation">
[d3970e1]111 <title>Installation of GDB</title>
[da73c1c]112 <!--
[d1e4f43]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>
[da73c1c]119-->
[d3970e1]120 <para>
121 Install <application>GDB</application> by running the following
122 commands:
123 </para>
[4b0ebf70]124
[29d11601]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;
[4b0ebf70]131make</userinput></screen>
132
[46fd248]133 <para>
134 Optionally, to build the API documentation using
135 <xref linkend="doxygen"/>, run:
136 </para>
137
[a42c273]138<screen remap="doc"><userinput>make -C gdb/doc doxy</userinput></screen>
[46fd248]139
[d3970e1]140 <para>
[03b05e7]141 To test the results, issue:
142 </para>
143
[a42c273]144<screen remap="test"><userinput>pushd gdb/testsuite &amp;&amp;
[03b05e7]145make site.exp &amp;&amp;
146echo "set gdb_test_timeout 120" &gt;&gt; site.exp &amp;&amp;
[a114fcc]147runtest
[03b05e7]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>.
[39e42c88]153 There are many problems with the test suite:
[d3970e1]154 </para>
[8558044]155
[39e42c88]156 <itemizedlist>
157 <listitem>
158 <para>
[3e42104]159 Clean directories are needed if re-running the tests. For that
[6a1237d]160 reason, make a copy of the compiled source code
[8558044]161 directory before the tests in case you need to run the tests again.
[39e42c88]162 </para>
163 </listitem>
[8558044]164
[39e42c88]165 <listitem>
166 <para>
167 Results depend on installed compilers.
168 </para>
169 </listitem>
[8558044]170<!-- I did not see this
[39e42c88]171 <listitem>
172 <para>
[8558044]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
[3e42104]176 run).
[39e42c88]177 </para>
178 </listitem>
[29d11601]179or this
[39e42c88]180 <listitem>
181 <para>
182 There are failures associated with system readline 6.x.
183 </para>
184 </listitem>
[29d11601]185-->
[e2fe6d4]186<!--
[39e42c88]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>
[e2fe6d4]195-->
[29d11601]196<!-- I don't know if this is true or not. I tested on a Haswell.
[24c0a06e]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>
[8558044]204-->
[39e42c88]205 <listitem>
206 <para>
[1fe05eb]207<!-- for gdb-11.1, gcc-11.2 - pierre
[54bd123]208 A test run of the test suite had about 1700 unexpected failures
[f863fd7d]209 (out of over 80000 tests). Over 1370 of the failures were related
[e2fe6d4]210 to FORTRAN tests. -->
[6f0a8c86]211<!-- for gdb-12.1, gcc-11.3.0 - bdubbs
[e2fe6d4]212 A test run of the test suite had a little over 200 unexpected failures
[6f0a8c86]213 out of over 94000 tests.-->
[da73c1c]214<!-- for gdb-13.0, gcc-12.2.0 - bdubbs
[6f0a8c86]215 A test run of the test suite had 33 unexpected failures
[da73c1c]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.
[39e42c88]220 </para>
221 </listitem>
[aea8090f]222
[bfbc72a]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
[aea8090f]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
[39e42c88]238 </itemizedlist>
[4b0ebf70]239
[d3970e1]240 <para>
241 Now, as the <systemitem class="username">root</systemitem> user:
242 </para>
[4b0ebf70]243
[da73c1c]244<screen role="root"><userinput>make -C gdb install &amp;&amp;
245make -C gdbserver install</userinput></screen>
[4b0ebf70]246
[852fc810]247 <para>
[46fd248]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):
[852fc810]251 </para>
252
[a42c273]253<screen role="root"
254 remap="doc"><userinput>install -d /usr/share/doc/gdb-&gdb-version; &amp;&amp;
[03b05e7]255rm -rf gdb/doc/doxy/xml &amp;&amp;
[852fc810]256cp -Rv gdb/doc/doxy /usr/share/doc/gdb-&gdb-version;</userinput></screen>
257
[4b0ebf70]258 </sect2>
[d3970e1]259
[870e9f05]260 <sect2 role="commands">
261 <title>Command Explanations</title>
[8558044]262
[870e9f05]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
[d38dc9a]269 <para>
270 <parameter>--with-python=/usr/bin/python3</parameter>: This switch
[54bd123]271 forces <application>GDB</application> to use Python 3.
[da73c1c]272 <!-- We don't advise to use python2 anymore
[54bd123]273 Remove this switch if you have installed
[da73c1c]274 <xref linkend="python2"/> and want to use it instead of Python 3.-->
[d38dc9a]275 </para>
276
[870e9f05]277 </sect2>
278
[4b0ebf70]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>
[4890200]288 <seg>
[da73c1c]289 gcore, gdb, gdbserver, and gdb-add-index
[4890200]290 </seg>
291 <seg>
[da73c1c]292 libinproctrace.so
[4890200]293 </seg>
294 <seg>
[03b05e7]295 /usr/{include,share}/gdb and /usr/share/doc/gdb-&gdb-version;
[4890200]296 </seg>
[4b0ebf70]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
[a55a187]305 <varlistentry id="gcore">
306 <term><command>gcore</command></term>
307 <listitem>
308 <para>
[4c24eb0a]309 generates a core dump of a running program
[a55a187]310 </para>
311 <indexterm zone="gdb gcore">
312 <primary sortas="b-gcore">gcore</primary>
313 </indexterm>
314 </listitem>
315 </varlistentry>
316
[4b0ebf70]317 <varlistentry id="gdb-prog">
318 <term><command>gdb</command></term>
319 <listitem>
[d3970e1]320 <para>
[4c24eb0a]321 is the GNU Debugger
[d3970e1]322 </para>
[4b0ebf70]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>
[d3970e1]332 <para>
[4890200]333 is a remote server for the GNU debugger (it allows programs
[4c24eb0a]334 to be debugged from a different machine)
[d3970e1]335 </para>
[4b0ebf70]336 <indexterm zone="gdb gdbserver">
337 <primary sortas="b-gdbserver">gdbserver</primary>
338 </indexterm>
339 </listitem>
340 </varlistentry>
341
[11f9b1d1]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
[4b0ebf70]355 <varlistentry id="libinproctrace">
[4890200]356 <term><filename class="libraryfile">libinproctrace.so</filename></term>
[4b0ebf70]357 <listitem>
[d3970e1]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>
[4b0ebf70]364 <indexterm zone="gdb libinproctrace">
365 <primary sortas="c-libinproctrace">libinproctrace.so</primary>
366 </indexterm>
367 </listitem>
[d3970e1]368 </varlistentry>
[11f9b1d1]369
[4b0ebf70]370 </variablelist>
371
372 </sect2>
373
374</sect1>
Note: See TracBrowser for help on using the repository browser.