source: general/prog/gdb.xml@ 2d1757d

12.0 12.1 12.2 gimp3 ken/TL2024 ken/tuningfonts lazarus lxqt plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/for-12.3 xry111/llvm18 xry111/spidermonkey128
Last change on this file since 2d1757d was 14891a90, checked in by Xi Ruoyao <xry111@…>, 15 months ago

treewide: More "User Notes" clean up

Remove links to pages w/o real contents.

  • Property mode set to 100644
File size: 11.2 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 </sect2>
106
107 <sect2 role="installation">
[d3970e1]108 <title>Installation of GDB</title>
[da73c1c]109 <!--
[d1e4f43]110 <para>
111 First, apply a patch that fixes problems when debugging programs compiled
112 with <xref linkend="rust" role="nodep"/>:
113 </para>
114
115<screen><userinput remap="pre">patch -Np1 -i ../gdb-&gdb-version;-upstream_fixes-1.patch</userinput></screen>
[da73c1c]116-->
[d3970e1]117 <para>
118 Install <application>GDB</application> by running the following
119 commands:
120 </para>
[4b0ebf70]121
[29d11601]122<screen><userinput>mkdir build &amp;&amp;
123cd build &amp;&amp;
124
125../configure --prefix=/usr \
126 --with-system-readline \
127 --with-python=/usr/bin/python3 &amp;&amp;
[4b0ebf70]128make</userinput></screen>
129
[46fd248]130 <para>
131 Optionally, to build the API documentation using
132 <xref linkend="doxygen"/>, run:
133 </para>
134
[a42c273]135<screen remap="doc"><userinput>make -C gdb/doc doxy</userinput></screen>
[46fd248]136
[d3970e1]137 <para>
[03b05e7]138 To test the results, issue:
139 </para>
140
[a42c273]141<screen remap="test"><userinput>pushd gdb/testsuite &amp;&amp;
[03b05e7]142make site.exp &amp;&amp;
143echo "set gdb_test_timeout 120" &gt;&gt; site.exp &amp;&amp;
[a114fcc]144runtest
[03b05e7]145popd</userinput></screen>
146
147 <para>
148 See <emphasis>gdb/testsuite/README</emphasis> and <ulink
149 url="https://sourceware.org/gdb/wiki/TestingGDB">TestingGDB</ulink>.
[39e42c88]150 There are many problems with the test suite:
[d3970e1]151 </para>
[8558044]152
[39e42c88]153 <itemizedlist>
154 <listitem>
155 <para>
[3e42104]156 Clean directories are needed if re-running the tests. For that
[6a1237d]157 reason, make a copy of the compiled source code
[8558044]158 directory before the tests in case you need to run the tests again.
[39e42c88]159 </para>
160 </listitem>
[8558044]161
[39e42c88]162 <listitem>
163 <para>
164 Results depend on installed compilers.
165 </para>
166 </listitem>
[8558044]167<!-- I did not see this
[39e42c88]168 <listitem>
169 <para>
[8558044]170 There are a large number of timeouts (there is a variable
171 that can be set to increase time for timeout, but
172 changing it will result in a different number of tests being
[3e42104]173 run).
[39e42c88]174 </para>
175 </listitem>
[29d11601]176or this
[39e42c88]177 <listitem>
178 <para>
179 There are failures associated with system readline 6.x.
180 </para>
181 </listitem>
[29d11601]182-->
[e2fe6d4]183<!--
[39e42c88]184 <listitem>
185 <para>
186 A few tests assume that the header file
187 <filename>&lt;sys/sdt.h&gt;</filename>, part of <ulink
188 url="https://sourceware.org/systemtap/">SystemTap</ulink>, is
189 present.
190 </para>
191 </listitem>
[e2fe6d4]192-->
[29d11601]193<!-- I don't know if this is true or not. I tested on a Haswell.
[24c0a06e]194 <listitem>
195 <para>
196 If the test suite is run on a Skylake-based Intel CPU or newer,
197 many tests will fail due to the removal of the deprecated/problematic
198 libmpx library in GCC.
199 </para>
200 </listitem>
[8558044]201-->
[39e42c88]202 <listitem>
203 <para>
[1fe05eb]204<!-- for gdb-11.1, gcc-11.2 - pierre
[54bd123]205 A test run of the test suite had about 1700 unexpected failures
[f863fd7d]206 (out of over 80000 tests). Over 1370 of the failures were related
[e2fe6d4]207 to FORTRAN tests. -->
[6f0a8c86]208<!-- for gdb-12.1, gcc-11.3.0 - bdubbs
[e2fe6d4]209 A test run of the test suite had a little over 200 unexpected failures
[6f0a8c86]210 out of over 94000 tests.-->
[da73c1c]211<!-- for gdb-13.0, gcc-12.2.0 - bdubbs
[6f0a8c86]212 A test run of the test suite had 33 unexpected failures
[da73c1c]213 out of over 106000 tests. -->
214<!-- for gdb-13.2, gcc-13.1.0 - pierre -->
215 A test run of the test suite had 183 unexpected failures
216 out of over 105000 tests.
[39e42c88]217 </para>
218 </listitem>
[aea8090f]219
[bfbc72a]220 <listitem>
221 <para>
222 On some systems, the gdb.tui test suite will fail if running over
223 SSH.
224 </para>
225 </listitem>
226
[aea8090f]227 <listitem>
228 <para>
229 On some AMD-based systems, over 200 additional tests
230 may fail due to a difference in the threading implementation
231 on those CPUs.
232 </para>
233 </listitem>
234
[39e42c88]235 </itemizedlist>
[4b0ebf70]236
[d3970e1]237 <para>
238 Now, as the <systemitem class="username">root</systemitem> user:
239 </para>
[4b0ebf70]240
[da73c1c]241<screen role="root"><userinput>make -C gdb install &amp;&amp;
242make -C gdbserver install</userinput></screen>
[4b0ebf70]243
[852fc810]244 <para>
[46fd248]245 If you have built the API documentation, it is now in gdb/doc/doxy.
246 You can install it (as the <systemitem class="username">root</systemitem>
247 user):
[852fc810]248 </para>
249
[a42c273]250<screen role="root"
251 remap="doc"><userinput>install -d /usr/share/doc/gdb-&gdb-version; &amp;&amp;
[03b05e7]252rm -rf gdb/doc/doxy/xml &amp;&amp;
[852fc810]253cp -Rv gdb/doc/doxy /usr/share/doc/gdb-&gdb-version;</userinput></screen>
254
[4b0ebf70]255 </sect2>
[d3970e1]256
[870e9f05]257 <sect2 role="commands">
258 <title>Command Explanations</title>
[8558044]259
[870e9f05]260 <para>
261 <parameter>--with-system-readline</parameter>: This switch forces
262 <application>GDB</application> to use the copy of
263 <application>Readline</application> installed in LFS.
264 </para>
265
[d38dc9a]266 <para>
267 <parameter>--with-python=/usr/bin/python3</parameter>: This switch
[54bd123]268 forces <application>GDB</application> to use Python 3.
[da73c1c]269 <!-- We don't advise to use python2 anymore
[54bd123]270 Remove this switch if you have installed
[da73c1c]271 <xref linkend="python2"/> and want to use it instead of Python 3.-->
[d38dc9a]272 </para>
273
[870e9f05]274 </sect2>
275
[4b0ebf70]276 <sect2 role="content">
277 <title>Contents</title>
278
279 <segmentedlist>
280 <segtitle>Installed Programs</segtitle>
281 <segtitle>Installed Library</segtitle>
282 <segtitle>Installed Directories</segtitle>
283
284 <seglistitem>
[4890200]285 <seg>
[da73c1c]286 gcore, gdb, gdbserver, and gdb-add-index
[4890200]287 </seg>
288 <seg>
[da73c1c]289 libinproctrace.so
[4890200]290 </seg>
291 <seg>
[03b05e7]292 /usr/{include,share}/gdb and /usr/share/doc/gdb-&gdb-version;
[4890200]293 </seg>
[4b0ebf70]294 </seglistitem>
295 </segmentedlist>
296
297 <variablelist>
298 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
299 <?dbfo list-presentation="list"?>
300 <?dbhtml list-presentation="table"?>
301
[a55a187]302 <varlistentry id="gcore">
303 <term><command>gcore</command></term>
304 <listitem>
305 <para>
[4c24eb0a]306 generates a core dump of a running program
[a55a187]307 </para>
308 <indexterm zone="gdb gcore">
309 <primary sortas="b-gcore">gcore</primary>
310 </indexterm>
311 </listitem>
312 </varlistentry>
313
[4b0ebf70]314 <varlistentry id="gdb-prog">
315 <term><command>gdb</command></term>
316 <listitem>
[d3970e1]317 <para>
[4c24eb0a]318 is the GNU Debugger
[d3970e1]319 </para>
[4b0ebf70]320 <indexterm zone="gdb gdb-prog">
321 <primary sortas="b-gdb-prog">gdb-prog</primary>
322 </indexterm>
323 </listitem>
324 </varlistentry>
325
326 <varlistentry id="gdbserver">
327 <term><command>gdbserver</command></term>
328 <listitem>
[d3970e1]329 <para>
[4890200]330 is a remote server for the GNU debugger (it allows programs
[4c24eb0a]331 to be debugged from a different machine)
[d3970e1]332 </para>
[4b0ebf70]333 <indexterm zone="gdb gdbserver">
334 <primary sortas="b-gdbserver">gdbserver</primary>
335 </indexterm>
336 </listitem>
337 </varlistentry>
338
[11f9b1d1]339 <varlistentry id="gdb-add-index">
340 <term><command>gdb-add-index</command></term>
341 <listitem>
342 <para>
343 Allows adding index files to ELF binaries. This speeds up
344 <command>gdb</command> start on large programs.
345 </para>
346 <indexterm zone="gdb gdb-add-index">
347 <primary sortas="b-gdb-add-index">gdb-add-index</primary>
348 </indexterm>
349 </listitem>
350 </varlistentry>
351
[4b0ebf70]352 <varlistentry id="libinproctrace">
[4890200]353 <term><filename class="libraryfile">libinproctrace.so</filename></term>
[4b0ebf70]354 <listitem>
[d3970e1]355 <para>
356 contains functions for the in-process tracing agent. The agent
357 allows for installing fast tracepoints, listing static tracepoint
358 markers, probing static tracepoints markers, and starting trace
359 monitoring.
360 </para>
[4b0ebf70]361 <indexterm zone="gdb libinproctrace">
362 <primary sortas="c-libinproctrace">libinproctrace.so</primary>
363 </indexterm>
364 </listitem>
[d3970e1]365 </varlistentry>
[11f9b1d1]366
[4b0ebf70]367 </variablelist>
368
369 </sect2>
370
371</sect1>
Note: See TracBrowser for help on using the repository browser.