[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 |
|
---|
[046d740] | 42 | &lfs112_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>
|
---|
[661e7eb] | 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). -->
|
---|
[17817c8] | 120 | <para>
|
---|
[661e7eb] | 121 | First, apply a change from upstream to fix issues with readline-8.2
|
---|
| 122 | or later:
|
---|
[17817c8] | 123 | </para>
|
---|
| 124 |
|
---|
[661e7eb] | 125 | <screen><userinput remap="pre">sed '/return/s/rl.*characters/(char *) &/' -i gdb/completer.c</userinput></screen>
|
---|
| 126 |
|
---|
| 127 |
|
---|
[d3970e1] | 128 | <para>
|
---|
| 129 | Install <application>GDB</application> by running the following
|
---|
| 130 | commands:
|
---|
| 131 | </para>
|
---|
[4b0ebf70] | 132 |
|
---|
[29d11601] | 133 | <screen><userinput>mkdir build &&
|
---|
| 134 | cd build &&
|
---|
| 135 |
|
---|
| 136 | ../configure --prefix=/usr \
|
---|
| 137 | --with-system-readline \
|
---|
| 138 | --with-python=/usr/bin/python3 &&
|
---|
[4b0ebf70] | 139 | make</userinput></screen>
|
---|
| 140 |
|
---|
[46fd248] | 141 | <para>
|
---|
| 142 | Optionally, to build the API documentation using
|
---|
| 143 | <xref linkend="doxygen"/>, run:
|
---|
| 144 | </para>
|
---|
| 145 |
|
---|
[a42c273] | 146 | <screen remap="doc"><userinput>make -C gdb/doc doxy</userinput></screen>
|
---|
[46fd248] | 147 |
|
---|
[d3970e1] | 148 | <para>
|
---|
[03b05e7] | 149 | To test the results, issue:
|
---|
| 150 | </para>
|
---|
| 151 |
|
---|
[a42c273] | 152 | <screen remap="test"><userinput>pushd gdb/testsuite &&
|
---|
[03b05e7] | 153 | make site.exp &&
|
---|
| 154 | echo "set gdb_test_timeout 120" >> site.exp &&
|
---|
[a114fcc] | 155 | runtest
|
---|
[03b05e7] | 156 | popd</userinput></screen>
|
---|
| 157 |
|
---|
| 158 | <para>
|
---|
| 159 | See <emphasis>gdb/testsuite/README</emphasis> and <ulink
|
---|
| 160 | url="https://sourceware.org/gdb/wiki/TestingGDB">TestingGDB</ulink>.
|
---|
[39e42c88] | 161 | There are many problems with the test suite:
|
---|
[d3970e1] | 162 | </para>
|
---|
[8558044] | 163 |
|
---|
[39e42c88] | 164 | <itemizedlist>
|
---|
| 165 | <listitem>
|
---|
| 166 | <para>
|
---|
[3e42104] | 167 | Clean directories are needed if re-running the tests. For that
|
---|
[6a1237d] | 168 | reason, make a copy of the compiled source code
|
---|
[8558044] | 169 | directory before the tests in case you need to run the tests again.
|
---|
[39e42c88] | 170 | </para>
|
---|
| 171 | </listitem>
|
---|
[8558044] | 172 |
|
---|
[39e42c88] | 173 | <listitem>
|
---|
| 174 | <para>
|
---|
| 175 | Results depend on installed compilers.
|
---|
| 176 | </para>
|
---|
| 177 | </listitem>
|
---|
[8558044] | 178 | <!-- I did not see this
|
---|
[39e42c88] | 179 | <listitem>
|
---|
| 180 | <para>
|
---|
[8558044] | 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
|
---|
[3e42104] | 184 | run).
|
---|
[39e42c88] | 185 | </para>
|
---|
| 186 | </listitem>
|
---|
[29d11601] | 187 | or this
|
---|
[39e42c88] | 188 | <listitem>
|
---|
| 189 | <para>
|
---|
| 190 | There are failures associated with system readline 6.x.
|
---|
| 191 | </para>
|
---|
| 192 | </listitem>
|
---|
[29d11601] | 193 | -->
|
---|
[e2fe6d4] | 194 | <!--
|
---|
[39e42c88] | 195 | <listitem>
|
---|
| 196 | <para>
|
---|
| 197 | A few tests assume that the header file
|
---|
| 198 | <filename><sys/sdt.h></filename>, part of <ulink
|
---|
| 199 | url="https://sourceware.org/systemtap/">SystemTap</ulink>, is
|
---|
| 200 | present.
|
---|
| 201 | </para>
|
---|
| 202 | </listitem>
|
---|
[e2fe6d4] | 203 | -->
|
---|
[29d11601] | 204 | <!-- I don't know if this is true or not. I tested on a Haswell.
|
---|
[24c0a06e] | 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>
|
---|
[8558044] | 212 | -->
|
---|
[39e42c88] | 213 | <listitem>
|
---|
| 214 | <para>
|
---|
[1fe05eb] | 215 | <!-- for gdb-11.1, gcc-11.2 - pierre
|
---|
[54bd123] | 216 | A test run of the test suite had about 1700 unexpected failures
|
---|
[f863fd7d] | 217 | (out of over 80000 tests). Over 1370 of the failures were related
|
---|
[e2fe6d4] | 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
|
---|
[1fe05eb] | 221 | out of over 94000 tests.
|
---|
[39e42c88] | 222 | </para>
|
---|
| 223 | </listitem>
|
---|
[aea8090f] | 224 |
|
---|
[bfbc72a] | 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 |
|
---|
[aea8090f] | 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 |
|
---|
[39e42c88] | 240 | </itemizedlist>
|
---|
[4b0ebf70] | 241 |
|
---|
[d3970e1] | 242 | <para>
|
---|
| 243 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 244 | </para>
|
---|
[4b0ebf70] | 245 |
|
---|
| 246 | <screen role="root"><userinput>make -C gdb install</userinput></screen>
|
---|
| 247 |
|
---|
[852fc810] | 248 | <para>
|
---|
[46fd248] | 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):
|
---|
[852fc810] | 252 | </para>
|
---|
| 253 |
|
---|
[a42c273] | 254 | <screen role="root"
|
---|
| 255 | remap="doc"><userinput>install -d /usr/share/doc/gdb-&gdb-version; &&
|
---|
[03b05e7] | 256 | rm -rf gdb/doc/doxy/xml &&
|
---|
[852fc810] | 257 | cp -Rv gdb/doc/doxy /usr/share/doc/gdb-&gdb-version;</userinput></screen>
|
---|
| 258 |
|
---|
[4b0ebf70] | 259 | </sect2>
|
---|
[d3970e1] | 260 |
|
---|
[870e9f05] | 261 | <sect2 role="commands">
|
---|
| 262 | <title>Command Explanations</title>
|
---|
[8558044] | 263 |
|
---|
[870e9f05] | 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 |
|
---|
[d38dc9a] | 270 | <para>
|
---|
| 271 | <parameter>--with-python=/usr/bin/python3</parameter>: This switch
|
---|
[54bd123] | 272 | forces <application>GDB</application> to use Python 3.
|
---|
| 273 | Remove this switch if you have installed
|
---|
[9533795] | 274 | <xref linkend="python2"/> and want to use it instead of Python 3.
|
---|
[d38dc9a] | 275 | </para>
|
---|
| 276 |
|
---|
[870e9f05] | 277 | </sect2>
|
---|
| 278 |
|
---|
[4b0ebf70] | 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>
|
---|
[4890200] | 288 | <seg>
|
---|
[6cd96df] | 289 | gcore, gdb and gdbserver
|
---|
[4890200] | 290 | </seg>
|
---|
| 291 | <seg>
|
---|
[a2e21ee] | 292 | <!--libinproctrace.so-->
|
---|
| 293 | None
|
---|
[4890200] | 294 | </seg>
|
---|
| 295 | <seg>
|
---|
[03b05e7] | 296 | /usr/{include,share}/gdb and /usr/share/doc/gdb-&gdb-version;
|
---|
[4890200] | 297 | </seg>
|
---|
[4b0ebf70] | 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 |
|
---|
[a55a187] | 306 | <varlistentry id="gcore">
|
---|
| 307 | <term><command>gcore</command></term>
|
---|
| 308 | <listitem>
|
---|
| 309 | <para>
|
---|
[4c24eb0a] | 310 | generates a core dump of a running program
|
---|
[a55a187] | 311 | </para>
|
---|
| 312 | <indexterm zone="gdb gcore">
|
---|
| 313 | <primary sortas="b-gcore">gcore</primary>
|
---|
| 314 | </indexterm>
|
---|
| 315 | </listitem>
|
---|
| 316 | </varlistentry>
|
---|
| 317 |
|
---|
[4b0ebf70] | 318 | <varlistentry id="gdb-prog">
|
---|
| 319 | <term><command>gdb</command></term>
|
---|
| 320 | <listitem>
|
---|
[d3970e1] | 321 | <para>
|
---|
[4c24eb0a] | 322 | is the GNU Debugger
|
---|
[d3970e1] | 323 | </para>
|
---|
[4b0ebf70] | 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>
|
---|
[d3970e1] | 333 | <para>
|
---|
[4890200] | 334 | is a remote server for the GNU debugger (it allows programs
|
---|
[4c24eb0a] | 335 | to be debugged from a different machine)
|
---|
[d3970e1] | 336 | </para>
|
---|
[4b0ebf70] | 337 | <indexterm zone="gdb gdbserver">
|
---|
| 338 | <primary sortas="b-gdbserver">gdbserver</primary>
|
---|
| 339 | </indexterm>
|
---|
| 340 | </listitem>
|
---|
| 341 | </varlistentry>
|
---|
| 342 |
|
---|
[a2e21ee] | 343 | <!-- Not present with 10.1
|
---|
[4b0ebf70] | 344 | <varlistentry id="libinproctrace">
|
---|
[4890200] | 345 | <term><filename class="libraryfile">libinproctrace.so</filename></term>
|
---|
[4b0ebf70] | 346 | <listitem>
|
---|
[d3970e1] | 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>
|
---|
[4b0ebf70] | 353 | <indexterm zone="gdb libinproctrace">
|
---|
| 354 | <primary sortas="c-libinproctrace">libinproctrace.so</primary>
|
---|
| 355 | </indexterm>
|
---|
| 356 | </listitem>
|
---|
[d3970e1] | 357 | </varlistentry>
|
---|
[a2e21ee] | 358 | -->
|
---|
[4b0ebf70] | 359 | </variablelist>
|
---|
| 360 |
|
---|
| 361 | </sect2>
|
---|
| 362 |
|
---|
| 363 | </sect1>
|
---|