[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">
|
---|
[e2fe6d4] | 9 | <!ENTITY gdb-md5sum "759a1b8d2b4d403367dd0e14fa04643d">
|
---|
[a2e21ee] | 10 | <!ENTITY gdb-size "21 MB">
|
---|
[e2fe6d4] | 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)">
|
---|
[4b0ebf70] | 13 | ]>
|
---|
| 14 |
|
---|
[5ad8a1f] | 15 | <!-- I skipped running the full tests for this 8.3.1 point version. Bruce -->
|
---|
| 16 |
|
---|
[d3970e1] | 17 | <sect1 id="gdb" xreflabel="GDB-&gdb-version;">
|
---|
[4b0ebf70] | 18 | <?dbhtml filename="gdb.html"?>
|
---|
| 19 |
|
---|
| 20 |
|
---|
[d3970e1] | 21 | <title>GDB-&gdb-version;</title>
|
---|
[4b0ebf70] | 22 |
|
---|
| 23 | <indexterm zone="gdb">
|
---|
[4890200] | 24 | <primary sortas="a-GDB">GDB</primary>
|
---|
[4b0ebf70] | 25 | </indexterm>
|
---|
| 26 |
|
---|
| 27 | <sect2 role="package">
|
---|
[d3970e1] | 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>
|
---|
[4b0ebf70] | 38 |
|
---|
[046d740] | 39 | &lfs112_checked;
|
---|
[4b0ebf70] | 40 |
|
---|
| 41 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 42 | <itemizedlist spacing="compact">
|
---|
| 43 | <listitem>
|
---|
[4890200] | 44 | <para>
|
---|
| 45 | Download (HTTP): <ulink url="&gdb-download-http;"/>
|
---|
| 46 | </para>
|
---|
[4b0ebf70] | 47 | </listitem>
|
---|
| 48 | <listitem>
|
---|
[4890200] | 49 | <para>
|
---|
| 50 | Download (FTP): <ulink url="&gdb-download-ftp;"/>
|
---|
| 51 | </para>
|
---|
[4b0ebf70] | 52 | </listitem>
|
---|
| 53 | <listitem>
|
---|
[4890200] | 54 | <para>
|
---|
| 55 | Download MD5 sum: &gdb-md5sum;
|
---|
| 56 | </para>
|
---|
[4b0ebf70] | 57 | </listitem>
|
---|
| 58 | <listitem>
|
---|
[4890200] | 59 | <para>
|
---|
| 60 | Download size: &gdb-size;
|
---|
| 61 | </para>
|
---|
[4b0ebf70] | 62 | </listitem>
|
---|
| 63 | <listitem>
|
---|
[4890200] | 64 | <para>
|
---|
| 65 | Estimated disk space required: &gdb-buildsize;
|
---|
| 66 | </para>
|
---|
[4b0ebf70] | 67 | </listitem>
|
---|
| 68 | <listitem>
|
---|
[4890200] | 69 | <para>
|
---|
| 70 | Estimated build time: &gdb-time;
|
---|
| 71 | </para>
|
---|
[4b0ebf70] | 72 | </listitem>
|
---|
| 73 | </itemizedlist>
|
---|
[56244269] | 74 | <!--
|
---|
[17817c8] | 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>
|
---|
[56244269] | 84 | -->
|
---|
[d3970e1] | 85 | <bridgehead renderas="sect3">GDB Dependencies</bridgehead>
|
---|
[d4c9b7c] | 86 |
|
---|
[9533795] | 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 |
|
---|
[d4c9b7c] | 94 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 95 | <para role="optional">
|
---|
[f4002c5] | 96 | <!-- <xref linkend="dejagnu"/> (required for tests), -->
|
---|
[852fc810] | 97 | <xref linkend="doxygen"/>,
|
---|
[a2e21ee] | 98 | <xref linkend="gcc"/> (ada, gfortran, and go are used for tests),
|
---|
[51cb7cd] | 99 | <xref linkend="guile"/>,
|
---|
[9533795] | 100 | <xref linkend="python2"/>,
|
---|
[51cb7cd] | 101 | <xref linkend="rust"/> (used for some tests),
|
---|
[2029b72] | 102 | <xref linkend="valgrind"/>, and
|
---|
| 103 | <ulink url="https://sourceware.org/systemtap/">SystemTap</ulink>
|
---|
[51cb7cd] | 104 | (run-time, used for tests)
|
---|
[d4c9b7c] | 105 | </para>
|
---|
| 106 |
|
---|
[4b0ebf70] | 107 | <para condition="html" role="usernotes">User Notes:
|
---|
[d3970e1] | 108 | <ulink url="&blfs-wiki;/gdb"/>
|
---|
| 109 | </para>
|
---|
[4b0ebf70] | 110 | </sect2>
|
---|
| 111 |
|
---|
| 112 | <sect2 role="installation">
|
---|
[d3970e1] | 113 | <title>Installation of GDB</title>
|
---|
[661e7eb] | 114 |
|
---|
| 115 | <!-- https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=1add37b
|
---|
| 116 | Will be included in 13.1, but not 12.2 (if there will be 12.2). -->
|
---|
[17817c8] | 117 | <para>
|
---|
[661e7eb] | 118 | First, apply a change from upstream to fix issues with readline-8.2
|
---|
| 119 | or later:
|
---|
[17817c8] | 120 | </para>
|
---|
| 121 |
|
---|
[661e7eb] | 122 | <screen><userinput remap="pre">sed '/return/s/rl.*characters/(char *) &/' -i gdb/completer.c</userinput></screen>
|
---|
| 123 |
|
---|
| 124 |
|
---|
[d3970e1] | 125 | <para>
|
---|
| 126 | Install <application>GDB</application> by running the following
|
---|
| 127 | commands:
|
---|
| 128 | </para>
|
---|
[4b0ebf70] | 129 |
|
---|
[29d11601] | 130 | <screen><userinput>mkdir build &&
|
---|
| 131 | cd build &&
|
---|
| 132 |
|
---|
| 133 | ../configure --prefix=/usr \
|
---|
| 134 | --with-system-readline \
|
---|
| 135 | --with-python=/usr/bin/python3 &&
|
---|
[4b0ebf70] | 136 | make</userinput></screen>
|
---|
| 137 |
|
---|
[46fd248] | 138 | <para>
|
---|
| 139 | Optionally, to build the API documentation using
|
---|
| 140 | <xref linkend="doxygen"/>, run:
|
---|
| 141 | </para>
|
---|
| 142 |
|
---|
[a42c273] | 143 | <screen remap="doc"><userinput>make -C gdb/doc doxy</userinput></screen>
|
---|
[46fd248] | 144 |
|
---|
[d3970e1] | 145 | <para>
|
---|
[03b05e7] | 146 | To test the results, issue:
|
---|
| 147 | </para>
|
---|
| 148 |
|
---|
[a42c273] | 149 | <screen remap="test"><userinput>pushd gdb/testsuite &&
|
---|
[03b05e7] | 150 | make site.exp &&
|
---|
| 151 | echo "set gdb_test_timeout 120" >> site.exp &&
|
---|
[a114fcc] | 152 | runtest
|
---|
[03b05e7] | 153 | popd</userinput></screen>
|
---|
| 154 |
|
---|
| 155 | <para>
|
---|
| 156 | See <emphasis>gdb/testsuite/README</emphasis> and <ulink
|
---|
| 157 | url="https://sourceware.org/gdb/wiki/TestingGDB">TestingGDB</ulink>.
|
---|
[39e42c88] | 158 | There are many problems with the test suite:
|
---|
[d3970e1] | 159 | </para>
|
---|
[8558044] | 160 |
|
---|
[39e42c88] | 161 | <itemizedlist>
|
---|
| 162 | <listitem>
|
---|
| 163 | <para>
|
---|
[3e42104] | 164 | Clean directories are needed if re-running the tests. For that
|
---|
[6a1237d] | 165 | reason, make a copy of the compiled source code
|
---|
[8558044] | 166 | directory before the tests in case you need to run the tests again.
|
---|
[39e42c88] | 167 | </para>
|
---|
| 168 | </listitem>
|
---|
[8558044] | 169 |
|
---|
[39e42c88] | 170 | <listitem>
|
---|
| 171 | <para>
|
---|
| 172 | Results depend on installed compilers.
|
---|
| 173 | </para>
|
---|
| 174 | </listitem>
|
---|
[8558044] | 175 | <!-- I did not see this
|
---|
[39e42c88] | 176 | <listitem>
|
---|
| 177 | <para>
|
---|
[8558044] | 178 | There are a large number of timeouts (there is a variable
|
---|
| 179 | that can be set to increase time for timeout, but
|
---|
| 180 | changing it will result in a different number of tests being
|
---|
[3e42104] | 181 | run).
|
---|
[39e42c88] | 182 | </para>
|
---|
| 183 | </listitem>
|
---|
[29d11601] | 184 | or this
|
---|
[39e42c88] | 185 | <listitem>
|
---|
| 186 | <para>
|
---|
| 187 | There are failures associated with system readline 6.x.
|
---|
| 188 | </para>
|
---|
| 189 | </listitem>
|
---|
[29d11601] | 190 | -->
|
---|
[e2fe6d4] | 191 | <!--
|
---|
[39e42c88] | 192 | <listitem>
|
---|
| 193 | <para>
|
---|
| 194 | A few tests assume that the header file
|
---|
| 195 | <filename><sys/sdt.h></filename>, part of <ulink
|
---|
| 196 | url="https://sourceware.org/systemtap/">SystemTap</ulink>, is
|
---|
| 197 | present.
|
---|
| 198 | </para>
|
---|
| 199 | </listitem>
|
---|
[e2fe6d4] | 200 | -->
|
---|
[29d11601] | 201 | <!-- I don't know if this is true or not. I tested on a Haswell.
|
---|
[24c0a06e] | 202 | <listitem>
|
---|
| 203 | <para>
|
---|
| 204 | If the test suite is run on a Skylake-based Intel CPU or newer,
|
---|
| 205 | many tests will fail due to the removal of the deprecated/problematic
|
---|
| 206 | libmpx library in GCC.
|
---|
| 207 | </para>
|
---|
| 208 | </listitem>
|
---|
[8558044] | 209 | -->
|
---|
[39e42c88] | 210 | <listitem>
|
---|
| 211 | <para>
|
---|
[1fe05eb] | 212 | <!-- for gdb-11.1, gcc-11.2 - pierre
|
---|
[54bd123] | 213 | A test run of the test suite had about 1700 unexpected failures
|
---|
[f863fd7d] | 214 | (out of over 80000 tests). Over 1370 of the failures were related
|
---|
[e2fe6d4] | 215 | to FORTRAN tests. -->
|
---|
| 216 | <!-- for gdb-12.1, gcc-11.3.0 - bdubbs -->
|
---|
| 217 | A test run of the test suite had a little over 200 unexpected failures
|
---|
[1fe05eb] | 218 | out of over 94000 tests.
|
---|
[39e42c88] | 219 | </para>
|
---|
| 220 | </listitem>
|
---|
[aea8090f] | 221 |
|
---|
[bfbc72a] | 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 |
|
---|
[aea8090f] | 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 |
|
---|
[39e42c88] | 237 | </itemizedlist>
|
---|
[4b0ebf70] | 238 |
|
---|
[d3970e1] | 239 | <para>
|
---|
| 240 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 241 | </para>
|
---|
[4b0ebf70] | 242 |
|
---|
| 243 | <screen role="root"><userinput>make -C gdb install</userinput></screen>
|
---|
| 244 |
|
---|
[852fc810] | 245 | <para>
|
---|
[46fd248] | 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):
|
---|
[852fc810] | 249 | </para>
|
---|
| 250 |
|
---|
[a42c273] | 251 | <screen role="root"
|
---|
| 252 | remap="doc"><userinput>install -d /usr/share/doc/gdb-&gdb-version; &&
|
---|
[03b05e7] | 253 | rm -rf gdb/doc/doxy/xml &&
|
---|
[852fc810] | 254 | cp -Rv gdb/doc/doxy /usr/share/doc/gdb-&gdb-version;</userinput></screen>
|
---|
| 255 |
|
---|
[4b0ebf70] | 256 | </sect2>
|
---|
[d3970e1] | 257 |
|
---|
[870e9f05] | 258 | <sect2 role="commands">
|
---|
| 259 | <title>Command Explanations</title>
|
---|
[8558044] | 260 |
|
---|
[870e9f05] | 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 |
|
---|
[d38dc9a] | 267 | <para>
|
---|
| 268 | <parameter>--with-python=/usr/bin/python3</parameter>: This switch
|
---|
[54bd123] | 269 | forces <application>GDB</application> to use Python 3.
|
---|
| 270 | Remove this switch if you have installed
|
---|
[9533795] | 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>
|
---|
[6cd96df] | 286 | gcore, gdb and gdbserver
|
---|
[4890200] | 287 | </seg>
|
---|
| 288 | <seg>
|
---|
[a2e21ee] | 289 | <!--libinproctrace.so-->
|
---|
| 290 | None
|
---|
[4890200] | 291 | </seg>
|
---|
| 292 | <seg>
|
---|
[03b05e7] | 293 | /usr/{include,share}/gdb and /usr/share/doc/gdb-&gdb-version;
|
---|
[4890200] | 294 | </seg>
|
---|
[4b0ebf70] | 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 |
|
---|
[a55a187] | 303 | <varlistentry id="gcore">
|
---|
| 304 | <term><command>gcore</command></term>
|
---|
| 305 | <listitem>
|
---|
| 306 | <para>
|
---|
[4c24eb0a] | 307 | generates a core dump of a running program
|
---|
[a55a187] | 308 | </para>
|
---|
| 309 | <indexterm zone="gdb gcore">
|
---|
| 310 | <primary sortas="b-gcore">gcore</primary>
|
---|
| 311 | </indexterm>
|
---|
| 312 | </listitem>
|
---|
| 313 | </varlistentry>
|
---|
| 314 |
|
---|
[4b0ebf70] | 315 | <varlistentry id="gdb-prog">
|
---|
| 316 | <term><command>gdb</command></term>
|
---|
| 317 | <listitem>
|
---|
[d3970e1] | 318 | <para>
|
---|
[4c24eb0a] | 319 | is the GNU Debugger
|
---|
[d3970e1] | 320 | </para>
|
---|
[4b0ebf70] | 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>
|
---|
[d3970e1] | 330 | <para>
|
---|
[4890200] | 331 | is a remote server for the GNU debugger (it allows programs
|
---|
[4c24eb0a] | 332 | to be debugged from a different machine)
|
---|
[d3970e1] | 333 | </para>
|
---|
[4b0ebf70] | 334 | <indexterm zone="gdb gdbserver">
|
---|
| 335 | <primary sortas="b-gdbserver">gdbserver</primary>
|
---|
| 336 | </indexterm>
|
---|
| 337 | </listitem>
|
---|
| 338 | </varlistentry>
|
---|
| 339 |
|
---|
[a2e21ee] | 340 | <!-- Not present with 10.1
|
---|
[4b0ebf70] | 341 | <varlistentry id="libinproctrace">
|
---|
[4890200] | 342 | <term><filename class="libraryfile">libinproctrace.so</filename></term>
|
---|
[4b0ebf70] | 343 | <listitem>
|
---|
[d3970e1] | 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>
|
---|
[4b0ebf70] | 350 | <indexterm zone="gdb libinproctrace">
|
---|
| 351 | <primary sortas="c-libinproctrace">libinproctrace.so</primary>
|
---|
| 352 | </indexterm>
|
---|
| 353 | </listitem>
|
---|
[d3970e1] | 354 | </varlistentry>
|
---|
[a2e21ee] | 355 | -->
|
---|
[4b0ebf70] | 356 | </variablelist>
|
---|
| 357 |
|
---|
| 358 | </sect2>
|
---|
| 359 |
|
---|
| 360 | </sect1>
|
---|