source: general/prog/gdb.xml@ 661e7eb

11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since 661e7eb was 661e7eb, checked in by Xi Ruoyao <xry111@…>, 19 months ago

gdb: fix FTBFS with readline-8.2

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