[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 | <sect1info>
|
---|
| 21 | <date>$Date$</date>
|
---|
| 22 | </sect1info>
|
---|
| 23 |
|
---|
[d3970e1] | 24 | <title>GDB-&gdb-version;</title>
|
---|
[4b0ebf70] | 25 |
|
---|
| 26 | <indexterm zone="gdb">
|
---|
[4890200] | 27 | <primary sortas="a-GDB">GDB</primary>
|
---|
[4b0ebf70] | 28 | </indexterm>
|
---|
| 29 |
|
---|
| 30 | <sect2 role="package">
|
---|
[d3970e1] | 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>
|
---|
[4b0ebf70] | 41 |
|
---|
[8c415ea] | 42 | &lfs111_checked;
|
---|
[4b0ebf70] | 43 |
|
---|
| 44 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 45 | <itemizedlist spacing="compact">
|
---|
| 46 | <listitem>
|
---|
[4890200] | 47 | <para>
|
---|
| 48 | Download (HTTP): <ulink url="&gdb-download-http;"/>
|
---|
| 49 | </para>
|
---|
[4b0ebf70] | 50 | </listitem>
|
---|
| 51 | <listitem>
|
---|
[4890200] | 52 | <para>
|
---|
| 53 | Download (FTP): <ulink url="&gdb-download-ftp;"/>
|
---|
| 54 | </para>
|
---|
[4b0ebf70] | 55 | </listitem>
|
---|
| 56 | <listitem>
|
---|
[4890200] | 57 | <para>
|
---|
| 58 | Download MD5 sum: &gdb-md5sum;
|
---|
| 59 | </para>
|
---|
[4b0ebf70] | 60 | </listitem>
|
---|
| 61 | <listitem>
|
---|
[4890200] | 62 | <para>
|
---|
| 63 | Download size: &gdb-size;
|
---|
| 64 | </para>
|
---|
[4b0ebf70] | 65 | </listitem>
|
---|
| 66 | <listitem>
|
---|
[4890200] | 67 | <para>
|
---|
| 68 | Estimated disk space required: &gdb-buildsize;
|
---|
| 69 | </para>
|
---|
[4b0ebf70] | 70 | </listitem>
|
---|
| 71 | <listitem>
|
---|
[4890200] | 72 | <para>
|
---|
| 73 | Estimated build time: &gdb-time;
|
---|
| 74 | </para>
|
---|
[4b0ebf70] | 75 | </listitem>
|
---|
| 76 | </itemizedlist>
|
---|
[56244269] | 77 | <!--
|
---|
[17817c8] | 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>
|
---|
[56244269] | 87 | -->
|
---|
[d3970e1] | 88 | <bridgehead renderas="sect3">GDB Dependencies</bridgehead>
|
---|
[d4c9b7c] | 89 |
|
---|
[9533795] | 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 |
|
---|
[d4c9b7c] | 97 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 98 | <para role="optional">
|
---|
[f4002c5] | 99 | <!-- <xref linkend="dejagnu"/> (required for tests), -->
|
---|
[852fc810] | 100 | <xref linkend="doxygen"/>,
|
---|
[a2e21ee] | 101 | <xref linkend="gcc"/> (ada, gfortran, and go are used for tests),
|
---|
[51cb7cd] | 102 | <xref linkend="guile"/>,
|
---|
[9533795] | 103 | <xref linkend="python2"/>,
|
---|
[51cb7cd] | 104 | <xref linkend="rust"/> (used for some tests),
|
---|
[2029b72] | 105 | <xref linkend="valgrind"/>, and
|
---|
| 106 | <ulink url="https://sourceware.org/systemtap/">SystemTap</ulink>
|
---|
[51cb7cd] | 107 | (run-time, used for tests)
|
---|
[d4c9b7c] | 108 | </para>
|
---|
| 109 |
|
---|
[4b0ebf70] | 110 | <para condition="html" role="usernotes">User Notes:
|
---|
[d3970e1] | 111 | <ulink url="&blfs-wiki;/gdb"/>
|
---|
| 112 | </para>
|
---|
[4b0ebf70] | 113 | </sect2>
|
---|
| 114 |
|
---|
| 115 | <sect2 role="installation">
|
---|
[d3970e1] | 116 | <title>Installation of GDB</title>
|
---|
[e2fe6d4] | 117 | <!--
|
---|
[17817c8] | 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>
|
---|
[e2fe6d4] | 123 | -->
|
---|
[d3970e1] | 124 | <para>
|
---|
| 125 | Install <application>GDB</application> by running the following
|
---|
| 126 | commands:
|
---|
| 127 | </para>
|
---|
[4b0ebf70] | 128 |
|
---|
[29d11601] | 129 | <screen><userinput>mkdir build &&
|
---|
| 130 | cd build &&
|
---|
| 131 |
|
---|
| 132 | ../configure --prefix=/usr \
|
---|
| 133 | --with-system-readline \
|
---|
| 134 | --with-python=/usr/bin/python3 &&
|
---|
[4b0ebf70] | 135 | make</userinput></screen>
|
---|
| 136 |
|
---|
[46fd248] | 137 | <para>
|
---|
| 138 | Optionally, to build the API documentation using
|
---|
| 139 | <xref linkend="doxygen"/>, run:
|
---|
| 140 | </para>
|
---|
| 141 |
|
---|
[a42c273] | 142 | <screen remap="doc"><userinput>make -C gdb/doc doxy</userinput></screen>
|
---|
[46fd248] | 143 |
|
---|
[d3970e1] | 144 | <para>
|
---|
[03b05e7] | 145 | To test the results, issue:
|
---|
| 146 | </para>
|
---|
| 147 |
|
---|
[a42c273] | 148 | <screen remap="test"><userinput>pushd gdb/testsuite &&
|
---|
[03b05e7] | 149 | make site.exp &&
|
---|
| 150 | echo "set gdb_test_timeout 120" >> site.exp &&
|
---|
[a114fcc] | 151 | runtest
|
---|
[03b05e7] | 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>.
|
---|
[39e42c88] | 157 | There are many problems with the test suite:
|
---|
[d3970e1] | 158 | </para>
|
---|
[8558044] | 159 |
|
---|
[39e42c88] | 160 | <itemizedlist>
|
---|
| 161 | <listitem>
|
---|
| 162 | <para>
|
---|
[3e42104] | 163 | Clean directories are needed if re-running the tests. For that
|
---|
[6a1237d] | 164 | reason, make a copy of the compiled source code
|
---|
[8558044] | 165 | directory before the tests in case you need to run the tests again.
|
---|
[39e42c88] | 166 | </para>
|
---|
| 167 | </listitem>
|
---|
[8558044] | 168 |
|
---|
[39e42c88] | 169 | <listitem>
|
---|
| 170 | <para>
|
---|
| 171 | Results depend on installed compilers.
|
---|
| 172 | </para>
|
---|
| 173 | </listitem>
|
---|
[8558044] | 174 | <!-- I did not see this
|
---|
[39e42c88] | 175 | <listitem>
|
---|
| 176 | <para>
|
---|
[8558044] | 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
|
---|
[3e42104] | 180 | run).
|
---|
[39e42c88] | 181 | </para>
|
---|
| 182 | </listitem>
|
---|
[29d11601] | 183 | or this
|
---|
[39e42c88] | 184 | <listitem>
|
---|
| 185 | <para>
|
---|
| 186 | There are failures associated with system readline 6.x.
|
---|
| 187 | </para>
|
---|
| 188 | </listitem>
|
---|
[29d11601] | 189 | -->
|
---|
[e2fe6d4] | 190 | <!--
|
---|
[39e42c88] | 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>
|
---|
[e2fe6d4] | 199 | -->
|
---|
[29d11601] | 200 | <!-- I don't know if this is true or not. I tested on a Haswell.
|
---|
[24c0a06e] | 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>
|
---|
[8558044] | 208 | -->
|
---|
[39e42c88] | 209 | <listitem>
|
---|
| 210 | <para>
|
---|
[e2fe6d4] | 211 | <!-- for gdb-11.1, gcc-11.2 - pierre
|
---|
[54bd123] | 212 | A test run of the test suite had about 1700 unexpected failures
|
---|
[f863fd7d] | 213 | (out of over 80000 tests). Over 1370 of the failures were related
|
---|
[e2fe6d4] | 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.
|
---|
[39e42c88] | 218 | </para>
|
---|
| 219 | </listitem>
|
---|
[aea8090f] | 220 |
|
---|
[bfbc72a] | 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 |
|
---|
[aea8090f] | 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 |
|
---|
[39e42c88] | 236 | </itemizedlist>
|
---|
[4b0ebf70] | 237 |
|
---|
[d3970e1] | 238 | <para>
|
---|
| 239 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 240 | </para>
|
---|
[4b0ebf70] | 241 |
|
---|
| 242 | <screen role="root"><userinput>make -C gdb install</userinput></screen>
|
---|
| 243 |
|
---|
[852fc810] | 244 | <para>
|
---|
[46fd248] | 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):
|
---|
[852fc810] | 248 | </para>
|
---|
| 249 |
|
---|
[a42c273] | 250 | <screen role="root"
|
---|
| 251 | remap="doc"><userinput>install -d /usr/share/doc/gdb-&gdb-version; &&
|
---|
[03b05e7] | 252 | rm -rf gdb/doc/doxy/xml &&
|
---|
[852fc810] | 253 | cp -Rv gdb/doc/doxy /usr/share/doc/gdb-&gdb-version;</userinput></screen>
|
---|
| 254 |
|
---|
[4b0ebf70] | 255 | </sect2>
|
---|
[d3970e1] | 256 |
|
---|
[870e9f05] | 257 | <sect2 role="commands">
|
---|
| 258 | <title>Command Explanations</title>
|
---|
[8558044] | 259 |
|
---|
[870e9f05] | 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 |
|
---|
[d38dc9a] | 266 | <para>
|
---|
| 267 | <parameter>--with-python=/usr/bin/python3</parameter>: This switch
|
---|
[54bd123] | 268 | forces <application>GDB</application> to use Python 3.
|
---|
| 269 | Remove this switch if you have installed
|
---|
[9533795] | 270 | <xref linkend="python2"/> and want to use it instead of Python 3.
|
---|
[d38dc9a] | 271 | </para>
|
---|
| 272 |
|
---|
[870e9f05] | 273 | </sect2>
|
---|
| 274 |
|
---|
[4b0ebf70] | 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>
|
---|
[4890200] | 284 | <seg>
|
---|
[6cd96df] | 285 | gcore, gdb and gdbserver
|
---|
[4890200] | 286 | </seg>
|
---|
| 287 | <seg>
|
---|
[a2e21ee] | 288 | <!--libinproctrace.so-->
|
---|
| 289 | None
|
---|
[4890200] | 290 | </seg>
|
---|
| 291 | <seg>
|
---|
[03b05e7] | 292 | /usr/{include,share}/gdb and /usr/share/doc/gdb-&gdb-version;
|
---|
[4890200] | 293 | </seg>
|
---|
[4b0ebf70] | 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 |
|
---|
[a55a187] | 302 | <varlistentry id="gcore">
|
---|
| 303 | <term><command>gcore</command></term>
|
---|
| 304 | <listitem>
|
---|
| 305 | <para>
|
---|
[4c24eb0a] | 306 | generates a core dump of a running program
|
---|
[a55a187] | 307 | </para>
|
---|
| 308 | <indexterm zone="gdb gcore">
|
---|
| 309 | <primary sortas="b-gcore">gcore</primary>
|
---|
| 310 | </indexterm>
|
---|
| 311 | </listitem>
|
---|
| 312 | </varlistentry>
|
---|
| 313 |
|
---|
[4b0ebf70] | 314 | <varlistentry id="gdb-prog">
|
---|
| 315 | <term><command>gdb</command></term>
|
---|
| 316 | <listitem>
|
---|
[d3970e1] | 317 | <para>
|
---|
[4c24eb0a] | 318 | is the GNU Debugger
|
---|
[d3970e1] | 319 | </para>
|
---|
[4b0ebf70] | 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>
|
---|
[d3970e1] | 329 | <para>
|
---|
[4890200] | 330 | is a remote server for the GNU debugger (it allows programs
|
---|
[4c24eb0a] | 331 | to be debugged from a different machine)
|
---|
[d3970e1] | 332 | </para>
|
---|
[4b0ebf70] | 333 | <indexterm zone="gdb gdbserver">
|
---|
| 334 | <primary sortas="b-gdbserver">gdbserver</primary>
|
---|
| 335 | </indexterm>
|
---|
| 336 | </listitem>
|
---|
| 337 | </varlistentry>
|
---|
| 338 |
|
---|
[a2e21ee] | 339 | <!-- Not present with 10.1
|
---|
[4b0ebf70] | 340 | <varlistentry id="libinproctrace">
|
---|
[4890200] | 341 | <term><filename class="libraryfile">libinproctrace.so</filename></term>
|
---|
[4b0ebf70] | 342 | <listitem>
|
---|
[d3970e1] | 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>
|
---|
[4b0ebf70] | 349 | <indexterm zone="gdb libinproctrace">
|
---|
| 350 | <primary sortas="c-libinproctrace">libinproctrace.so</primary>
|
---|
| 351 | </indexterm>
|
---|
| 352 | </listitem>
|
---|
[d3970e1] | 353 | </varlistentry>
|
---|
[a2e21ee] | 354 | -->
|
---|
[4b0ebf70] | 355 | </variablelist>
|
---|
| 356 |
|
---|
| 357 | </sect2>
|
---|
| 358 |
|
---|
| 359 | </sect1>
|
---|