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 | &lfs111_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 | <para>
|
---|
119 | First, apply some changes from upstream to fix issues with glibc-2.35:
|
---|
120 | </para>
|
---|
121 |
|
---|
122 | <screen><userinput remap="pre">patch -Np1 -i ../gdb-&gdb-version;-upstream_fixes-1.patch</userinput></screen>
|
---|
123 | -->
|
---|
124 | <para>
|
---|
125 | Install <application>GDB</application> by running the following
|
---|
126 | commands:
|
---|
127 | </para>
|
---|
128 |
|
---|
129 | <screen><userinput>mkdir build &&
|
---|
130 | cd build &&
|
---|
131 |
|
---|
132 | ../configure --prefix=/usr \
|
---|
133 | --with-system-readline \
|
---|
134 | --with-python=/usr/bin/python3 &&
|
---|
135 | make</userinput></screen>
|
---|
136 |
|
---|
137 | <para>
|
---|
138 | Optionally, to build the API documentation using
|
---|
139 | <xref linkend="doxygen"/>, run:
|
---|
140 | </para>
|
---|
141 |
|
---|
142 | <screen remap="doc"><userinput>make -C gdb/doc doxy</userinput></screen>
|
---|
143 |
|
---|
144 | <para>
|
---|
145 | To test the results, issue:
|
---|
146 | </para>
|
---|
147 |
|
---|
148 | <screen remap="test"><userinput>pushd gdb/testsuite &&
|
---|
149 | make site.exp &&
|
---|
150 | echo "set gdb_test_timeout 120" >> site.exp &&
|
---|
151 | runtest
|
---|
152 | popd</userinput></screen>
|
---|
153 |
|
---|
154 | <para>
|
---|
155 | See <emphasis>gdb/testsuite/README</emphasis> and <ulink
|
---|
156 | url="https://sourceware.org/gdb/wiki/TestingGDB">TestingGDB</ulink>.
|
---|
157 | There are many problems with the test suite:
|
---|
158 | </para>
|
---|
159 |
|
---|
160 | <itemizedlist>
|
---|
161 | <listitem>
|
---|
162 | <para>
|
---|
163 | Clean directories are needed if re-running the tests. For that
|
---|
164 | reason, make a copy of the compiled source code
|
---|
165 | directory before the tests in case you need to run the tests again.
|
---|
166 | </para>
|
---|
167 | </listitem>
|
---|
168 |
|
---|
169 | <listitem>
|
---|
170 | <para>
|
---|
171 | Results depend on installed compilers.
|
---|
172 | </para>
|
---|
173 | </listitem>
|
---|
174 | <!-- I did not see this
|
---|
175 | <listitem>
|
---|
176 | <para>
|
---|
177 | There are a large number of timeouts (there is a variable
|
---|
178 | that can be set to increase time for timeout, but
|
---|
179 | changing it will result in a different number of tests being
|
---|
180 | run).
|
---|
181 | </para>
|
---|
182 | </listitem>
|
---|
183 | or this
|
---|
184 | <listitem>
|
---|
185 | <para>
|
---|
186 | There are failures associated with system readline 6.x.
|
---|
187 | </para>
|
---|
188 | </listitem>
|
---|
189 | -->
|
---|
190 | <!--
|
---|
191 | <listitem>
|
---|
192 | <para>
|
---|
193 | A few tests assume that the header file
|
---|
194 | <filename><sys/sdt.h></filename>, part of <ulink
|
---|
195 | url="https://sourceware.org/systemtap/">SystemTap</ulink>, is
|
---|
196 | present.
|
---|
197 | </para>
|
---|
198 | </listitem>
|
---|
199 | -->
|
---|
200 | <!-- I don't know if this is true or not. I tested on a Haswell.
|
---|
201 | <listitem>
|
---|
202 | <para>
|
---|
203 | If the test suite is run on a Skylake-based Intel CPU or newer,
|
---|
204 | many tests will fail due to the removal of the deprecated/problematic
|
---|
205 | libmpx library in GCC.
|
---|
206 | </para>
|
---|
207 | </listitem>
|
---|
208 | -->
|
---|
209 | <listitem>
|
---|
210 | <para>
|
---|
211 | <!-- for gdb-11.1, gcc-11.2 - pierre
|
---|
212 | A test run of the test suite had about 1700 unexpected failures
|
---|
213 | (out of over 80000 tests). Over 1370 of the failures were related
|
---|
214 | to FORTRAN tests. -->
|
---|
215 | <!-- for gdb-12.1, gcc-11.3.0 - bdubbs -->
|
---|
216 | A test run of the test suite had a little over 200 unexpected failures
|
---|
217 | out of over 94000 tests.
|
---|
218 | </para>
|
---|
219 | </listitem>
|
---|
220 |
|
---|
221 | <listitem>
|
---|
222 | <para>
|
---|
223 | On some systems, the gdb.tui test suite will fail if running over
|
---|
224 | SSH.
|
---|
225 | </para>
|
---|
226 | </listitem>
|
---|
227 |
|
---|
228 | <listitem>
|
---|
229 | <para>
|
---|
230 | On some AMD-based systems, over 200 additional tests
|
---|
231 | may fail due to a difference in the threading implementation
|
---|
232 | on those CPUs.
|
---|
233 | </para>
|
---|
234 | </listitem>
|
---|
235 |
|
---|
236 | </itemizedlist>
|
---|
237 |
|
---|
238 | <para>
|
---|
239 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
240 | </para>
|
---|
241 |
|
---|
242 | <screen role="root"><userinput>make -C gdb install</userinput></screen>
|
---|
243 |
|
---|
244 | <para>
|
---|
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):
|
---|
248 | </para>
|
---|
249 |
|
---|
250 | <screen role="root"
|
---|
251 | remap="doc"><userinput>install -d /usr/share/doc/gdb-&gdb-version; &&
|
---|
252 | rm -rf gdb/doc/doxy/xml &&
|
---|
253 | cp -Rv gdb/doc/doxy /usr/share/doc/gdb-&gdb-version;</userinput></screen>
|
---|
254 |
|
---|
255 | </sect2>
|
---|
256 |
|
---|
257 | <sect2 role="commands">
|
---|
258 | <title>Command Explanations</title>
|
---|
259 |
|
---|
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 |
|
---|
266 | <para>
|
---|
267 | <parameter>--with-python=/usr/bin/python3</parameter>: This switch
|
---|
268 | forces <application>GDB</application> to use Python 3.
|
---|
269 | Remove this switch if you have installed
|
---|
270 | <xref linkend="python2"/> and want to use it instead of Python 3.
|
---|
271 | </para>
|
---|
272 |
|
---|
273 | </sect2>
|
---|
274 |
|
---|
275 | <sect2 role="content">
|
---|
276 | <title>Contents</title>
|
---|
277 |
|
---|
278 | <segmentedlist>
|
---|
279 | <segtitle>Installed Programs</segtitle>
|
---|
280 | <segtitle>Installed Library</segtitle>
|
---|
281 | <segtitle>Installed Directories</segtitle>
|
---|
282 |
|
---|
283 | <seglistitem>
|
---|
284 | <seg>
|
---|
285 | gcore, gdb and gdbserver
|
---|
286 | </seg>
|
---|
287 | <seg>
|
---|
288 | <!--libinproctrace.so-->
|
---|
289 | None
|
---|
290 | </seg>
|
---|
291 | <seg>
|
---|
292 | /usr/{include,share}/gdb and /usr/share/doc/gdb-&gdb-version;
|
---|
293 | </seg>
|
---|
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 |
|
---|
302 | <varlistentry id="gcore">
|
---|
303 | <term><command>gcore</command></term>
|
---|
304 | <listitem>
|
---|
305 | <para>
|
---|
306 | generates a core dump of a running program
|
---|
307 | </para>
|
---|
308 | <indexterm zone="gdb gcore">
|
---|
309 | <primary sortas="b-gcore">gcore</primary>
|
---|
310 | </indexterm>
|
---|
311 | </listitem>
|
---|
312 | </varlistentry>
|
---|
313 |
|
---|
314 | <varlistentry id="gdb-prog">
|
---|
315 | <term><command>gdb</command></term>
|
---|
316 | <listitem>
|
---|
317 | <para>
|
---|
318 | is the GNU Debugger
|
---|
319 | </para>
|
---|
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>
|
---|
329 | <para>
|
---|
330 | is a remote server for the GNU debugger (it allows programs
|
---|
331 | to be debugged from a different machine)
|
---|
332 | </para>
|
---|
333 | <indexterm zone="gdb gdbserver">
|
---|
334 | <primary sortas="b-gdbserver">gdbserver</primary>
|
---|
335 | </indexterm>
|
---|
336 | </listitem>
|
---|
337 | </varlistentry>
|
---|
338 |
|
---|
339 | <!-- Not present with 10.1
|
---|
340 | <varlistentry id="libinproctrace">
|
---|
341 | <term><filename class="libraryfile">libinproctrace.so</filename></term>
|
---|
342 | <listitem>
|
---|
343 | <para>
|
---|
344 | contains functions for the in-process tracing agent. The agent
|
---|
345 | allows for installing fast tracepoints, listing static tracepoint
|
---|
346 | markers, probing static tracepoints markers, and starting trace
|
---|
347 | monitoring.
|
---|
348 | </para>
|
---|
349 | <indexterm zone="gdb libinproctrace">
|
---|
350 | <primary sortas="c-libinproctrace">libinproctrace.so</primary>
|
---|
351 | </indexterm>
|
---|
352 | </listitem>
|
---|
353 | </varlistentry>
|
---|
354 | -->
|
---|
355 | </variablelist>
|
---|
356 |
|
---|
357 | </sect2>
|
---|
358 |
|
---|
359 | </sect1>
|
---|