source: general/prog/gdb.xml@ ef36e6dc

12.2 lazarus trunk xry111/for-12.3
Last change on this file since ef36e6dc was 9aeac59, checked in by Bruce Dubbs <bdubbs@…>, 2 months ago

Update to gdb-15.1.

  • Property mode set to 100644
File size: 12.3 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
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 " ">
9 <!ENTITY gdb-md5sum "494e3beaac44e66367c3e443a4414529">
10 <!ENTITY gdb-size "23 MB">
11 <!ENTITY gdb-buildsize "806 MB (add 1.0 GB for docs; add 720 MB for tests)">
12 <!ENTITY gdb-time "0.9 SBU (add 0.4 SBU for docs; see below for tests; all using parallelism=8)">
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 &lfs121_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 <xref linkend="rust"/> (used for some tests),
98 <xref linkend="valgrind"/>, and
99 <ulink url="https://sourceware.org/systemtap/">SystemTap</ulink>
100 (run-time, used for tests)
101 </para>
102
103 </sect2>
104
105 <sect2 role="installation">
106 <title>Installation of GDB</title>
107 <!--
108 <para>
109 First, apply a patch that fixes problems when debugging programs compiled
110 with <xref linkend="rust" role="nodep"/>:
111 </para>
112
113<screen><userinput remap="pre">patch -Np1 -i ../gdb-&gdb-version;-upstream_fixes-1.patch</userinput></screen>
114-->
115 <para>
116 Install <application>GDB</application> by running the following
117 commands:
118 </para>
119
120<screen><userinput>mkdir build &amp;&amp;
121cd build &amp;&amp;
122
123../configure --prefix=/usr \
124 --with-system-readline \
125 --with-python=/usr/bin/python3 &amp;&amp;
126make</userinput></screen>
127
128 <para>
129 Optionally, to build the API documentation using
130 <xref linkend="doxygen"/>, run:
131 </para>
132
133<screen remap="doc"><userinput>make -C gdb/doc doxy</userinput></screen>
134
135 <para>
136 Running the tests is not recommended. The results vary a lot depending
137 on the system architecture and what optional dependencies are installed
138 and what version of gcc is being used. On one system tested, there were
139 140 unexpected failures (out of over 108,000 tests) and on another system
140 there were "only" 32 unexpected failures. The time to run the tests
141 varies from approximately 6 SBU to over 15 SBU when using -j8. This depends
142 on number of tests that time out as will as other factors.
143 </para>
144
145 <tip>
146 <para>
147 With a plain <command>make check</command>, there are many warning
148 messages about a missing global configuration file. These can be
149 avoided by running <command>touch global.exp</command> and prepending
150 the <command>make check</command> command with
151 <command>DEJAGNU=$PWD/global.exp</command>. In addition the tests can
152 be speeded up considerably by using the <command>make</command> option
153 "-j&lt;N&gt;" where &lt;N&gt; is the number of cores on your system.
154 </para>
155 </tip>
156
157 <para>
158 To test the results anyway, issue:
159 </para>
160
161<screen remap="test"><userinput>pushd gdb/testsuite &amp;&amp;
162make site.exp &amp;&amp;
163echo "set gdb_test_timeout 30" &gt;&gt; site.exp &amp;&amp;
164make check 2&gt;1 | tee gdb-check.log
165popd</userinput></screen>
166
167 <para>
168 See <emphasis>gdb/testsuite/README</emphasis> and <ulink
169 url="https://sourceware.org/gdb/wiki/TestingGDB">TestingGDB</ulink>.
170 There are many additional problems with the test suite:
171 </para>
172
173 <itemizedlist>
174 <listitem>
175 <para>
176 Clean directories are needed if re-running the tests. For that
177 reason, make a copy of the compiled source code
178 directory before the tests in case you need to run the tests again.
179 </para>
180 </listitem>
181
182 <listitem>
183 <para>
184 Results depend on installed compilers.
185 </para>
186 </listitem>
187<!-- I did not see this
188 <listitem>
189 <para>
190 There are a large number of timeouts (there is a variable
191 that can be set to increase time for timeout, but
192 changing it will result in a different number of tests being
193 run).
194 </para>
195 </listitem>
196or this
197 <listitem>
198 <para>
199 There are failures associated with system readline 6.x.
200 </para>
201 </listitem>
202-->
203<!--
204 <listitem>
205 <para>
206 A few tests assume that the header file
207 <filename>&lt;sys/sdt.h&gt;</filename>, part of <ulink
208 url="https://sourceware.org/systemtap/">SystemTap</ulink>, is
209 present.
210 </para>
211 </listitem>
212-->
213<!-- I don't know if this is true or not. I tested on a Haswell.
214 <listitem>
215 <para>
216 If the test suite is run on a Skylake-based Intel CPU or newer,
217 many tests will fail due to the removal of the deprecated/problematic
218 libmpx library in GCC.
219 </para>
220 </listitem>
221-->
222<!-- <listitem>
223 <para>
224-->
225<!-- for gdb-11.1, gcc-11.2 - pierre
226 A test run of the test suite had about 1700 unexpected failures
227 (out of over 80000 tests). Over 1370 of the failures were related
228 to FORTRAN tests. -->
229<!-- for gdb-12.1, gcc-11.3.0 - bdubbs
230 A test run of the test suite had a little over 200 unexpected failures
231 out of over 94000 tests.-->
232<!-- for gdb-13.0, gcc-12.2.0 - bdubbs
233 A test run of the test suite had 33 unexpected failures
234 out of over 106000 tests. -->
235<!-- for gdb-13.2, gcc-13.1.0 - pierre
236 A test run of the test suite had 183 unexpected failures
237 out of over 105000 tests. -->
238<!-- for gdb-14.1, gcc 13.2.0 - rahul -->
239<!-- A test run of the test suite had 51 unexpected failures
240 out of the over 106000 tests.
241 </para>
242 </listitem>
243
244 <listitem>
245 <para>
246 On some systems, the gdb.tui test suite will fail if running over
247 SSH.
248 </para>
249 </listitem>
250-->
251 <listitem>
252 <para>
253 On some AMD-based systems, over 200 additional tests
254 may fail due to a difference in the threading implementation
255 on those CPUs.
256 </para>
257 </listitem>
258
259 </itemizedlist>
260
261 <para>
262 Now, as the <systemitem class="username">root</systemitem> user:
263 </para>
264
265<screen role="root"><userinput>make -C gdb install &amp;&amp;
266make -C gdbserver install</userinput></screen>
267
268 <para>
269 If you have built the API documentation, it is now in gdb/doc/doxy.
270 You can install it (as the <systemitem class="username">root</systemitem>
271 user):
272 </para>
273
274<screen role="root"
275 remap="doc"><userinput>install -d /usr/share/doc/gdb-&gdb-version; &amp;&amp;
276rm -rf gdb/doc/doxy/xml &amp;&amp;
277cp -Rv gdb/doc/doxy /usr/share/doc/gdb-&gdb-version;</userinput></screen>
278
279 </sect2>
280
281 <sect2 role="commands">
282 <title>Command Explanations</title>
283
284 <para>
285 <parameter>--with-system-readline</parameter>: This switch forces
286 <application>GDB</application> to use the copy of
287 <application>Readline</application> installed in LFS.
288 </para>
289
290 <para>
291 <parameter>--with-python=/usr/bin/python3</parameter>: This switch
292 forces <application>GDB</application> to use Python 3.
293 </para>
294
295 </sect2>
296
297 <sect2 role="content">
298 <title>Contents</title>
299
300 <segmentedlist>
301 <segtitle>Installed Programs</segtitle>
302 <segtitle>Installed Library</segtitle>
303 <segtitle>Installed Directories</segtitle>
304
305 <seglistitem>
306 <seg>
307 gcore, gdb, gdbserver, and gdb-add-index
308 </seg>
309 <seg>
310 libinproctrace.so
311 </seg>
312 <seg>
313 /usr/{include,share}/gdb and /usr/share/doc/gdb-&gdb-version;
314 </seg>
315 </seglistitem>
316 </segmentedlist>
317
318 <variablelist>
319 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
320 <?dbfo list-presentation="list"?>
321 <?dbhtml list-presentation="table"?>
322
323 <varlistentry id="gcore">
324 <term><command>gcore</command></term>
325 <listitem>
326 <para>
327 generates a core dump of a running program
328 </para>
329 <indexterm zone="gdb gcore">
330 <primary sortas="b-gcore">gcore</primary>
331 </indexterm>
332 </listitem>
333 </varlistentry>
334
335 <varlistentry id="gdb-prog">
336 <term><command>gdb</command></term>
337 <listitem>
338 <para>
339 is the GNU Debugger
340 </para>
341 <indexterm zone="gdb gdb-prog">
342 <primary sortas="b-gdb-prog">gdb-prog</primary>
343 </indexterm>
344 </listitem>
345 </varlistentry>
346
347 <varlistentry id="gdbserver">
348 <term><command>gdbserver</command></term>
349 <listitem>
350 <para>
351 is a remote server for the GNU debugger (it allows programs
352 to be debugged from a different machine)
353 </para>
354 <indexterm zone="gdb gdbserver">
355 <primary sortas="b-gdbserver">gdbserver</primary>
356 </indexterm>
357 </listitem>
358 </varlistentry>
359
360 <varlistentry id="gdb-add-index">
361 <term><command>gdb-add-index</command></term>
362 <listitem>
363 <para>
364 Allows adding index files to ELF binaries. This speeds up
365 <command>gdb</command> start on large programs.
366 </para>
367 <indexterm zone="gdb gdb-add-index">
368 <primary sortas="b-gdb-add-index">gdb-add-index</primary>
369 </indexterm>
370 </listitem>
371 </varlistentry>
372
373 <varlistentry id="libinproctrace">
374 <term><filename class="libraryfile">libinproctrace.so</filename></term>
375 <listitem>
376 <para>
377 contains functions for the in-process tracing agent. The agent
378 allows for installing fast tracepoints, listing static tracepoint
379 markers, probing static tracepoints markers, and starting trace
380 monitoring.
381 </para>
382 <indexterm zone="gdb libinproctrace">
383 <primary sortas="c-libinproctrace">libinproctrace.so</primary>
384 </indexterm>
385 </listitem>
386 </varlistentry>
387
388 </variablelist>
389
390 </sect2>
391
392</sect1>
Note: See TracBrowser for help on using the repository browser.