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