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