[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">
|
---|
[5ad8a1f] | 9 | <!ENTITY gdb-md5sum "73b6a5d8141672c62bf851cd34c4aa83">
|
---|
[6a1237d] | 10 | <!ENTITY gdb-size "20 MB">
|
---|
[5ad8a1f] | 11 | <!ENTITY gdb-buildsize "625 MB (add 57 MB for tests, add 748 MB for docs)">
|
---|
| 12 | <!ENTITY gdb-time "1.9 SBU (Using parallelism=4; add 66 SBU for tests, add 0.6 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 |
|
---|
[3fcb10e1] | 43 | &lfs90_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">
|
---|
[51cb7cd] | 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 |
|
---|
[9533795] | 114 | <screen><userinput>./configure --prefix=/usr \
|
---|
| 115 | --with-system-readline \
|
---|
| 116 | --with-python=/usr/bin/python3 &&
|
---|
[4b0ebf70] | 117 | make</userinput></screen>
|
---|
| 118 |
|
---|
[46fd248] | 119 | <para>
|
---|
| 120 | Optionally, to build the API documentation using
|
---|
| 121 | <xref linkend="doxygen"/>, run:
|
---|
| 122 | </para>
|
---|
| 123 |
|
---|
[a42c273] | 124 | <screen remap="doc"><userinput>make -C gdb/doc doxy</userinput></screen>
|
---|
[46fd248] | 125 |
|
---|
[d3970e1] | 126 | <para>
|
---|
[03b05e7] | 127 | To test the results, issue:
|
---|
| 128 | </para>
|
---|
| 129 |
|
---|
[a42c273] | 130 | <screen remap="test"><userinput>pushd gdb/testsuite &&
|
---|
[03b05e7] | 131 | make site.exp &&
|
---|
| 132 | echo "set gdb_test_timeout 120" >> site.exp &&
|
---|
[a114fcc] | 133 | runtest
|
---|
[03b05e7] | 134 | popd</userinput></screen>
|
---|
| 135 |
|
---|
| 136 | <para>
|
---|
| 137 | See <emphasis>gdb/testsuite/README</emphasis> and <ulink
|
---|
| 138 | url="https://sourceware.org/gdb/wiki/TestingGDB">TestingGDB</ulink>.
|
---|
[39e42c88] | 139 | There are many problems with the test suite:
|
---|
[d3970e1] | 140 | </para>
|
---|
[39e42c88] | 141 |
|
---|
| 142 | <itemizedlist>
|
---|
| 143 | <listitem>
|
---|
| 144 | <para>
|
---|
[3e42104] | 145 | Clean directories are needed if re-running the tests. For that
|
---|
[6a1237d] | 146 | reason, make a copy of the compiled source code
|
---|
[39e42c88] | 147 | directory before the tests in case you need to run the tests again.
|
---|
| 148 | </para>
|
---|
| 149 | </listitem>
|
---|
| 150 |
|
---|
| 151 | <listitem>
|
---|
| 152 | <para>
|
---|
| 153 | Results depend on installed compilers.
|
---|
| 154 | </para>
|
---|
| 155 | </listitem>
|
---|
| 156 |
|
---|
| 157 | <listitem>
|
---|
| 158 | <para>
|
---|
| 159 | There are a large number of timeouts (there is a variable
|
---|
| 160 | that can be set to increase time for timeout, but
|
---|
| 161 | changing it will result in a different number of tests being
|
---|
[3e42104] | 162 | run).
|
---|
[39e42c88] | 163 | </para>
|
---|
| 164 | </listitem>
|
---|
| 165 |
|
---|
| 166 | <listitem>
|
---|
| 167 | <para>
|
---|
| 168 | There are failures associated with system readline 6.x.
|
---|
| 169 | </para>
|
---|
| 170 | </listitem>
|
---|
| 171 |
|
---|
| 172 | <listitem>
|
---|
| 173 | <para>
|
---|
| 174 | A few tests assume that the header file
|
---|
| 175 | <filename><sys/sdt.h></filename>, part of <ulink
|
---|
| 176 | url="https://sourceware.org/systemtap/">SystemTap</ulink>, is
|
---|
| 177 | present.
|
---|
| 178 | </para>
|
---|
| 179 | </listitem>
|
---|
[24c0a06e] | 180 |
|
---|
| 181 | <listitem>
|
---|
| 182 | <para>
|
---|
| 183 | If the test suite is run on a Skylake-based Intel CPU or newer,
|
---|
| 184 | many tests will fail due to the removal of the deprecated/problematic
|
---|
| 185 | libmpx library in GCC.
|
---|
| 186 | </para>
|
---|
| 187 | </listitem>
|
---|
[39e42c88] | 188 |
|
---|
| 189 | <listitem>
|
---|
| 190 | <para>
|
---|
[a114fcc] | 191 | Approximately 1-3% of the tests fail (out of over 56000 tests).
|
---|
[39e42c88] | 192 | </para>
|
---|
| 193 | </listitem>
|
---|
| 194 |
|
---|
| 195 | </itemizedlist>
|
---|
[4b0ebf70] | 196 |
|
---|
[d3970e1] | 197 | <para>
|
---|
| 198 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 199 | </para>
|
---|
[4b0ebf70] | 200 |
|
---|
| 201 | <screen role="root"><userinput>make -C gdb install</userinput></screen>
|
---|
| 202 |
|
---|
[852fc810] | 203 | <para>
|
---|
[46fd248] | 204 | If you have built the API documentation, it is now in gdb/doc/doxy.
|
---|
| 205 | You can install it (as the <systemitem class="username">root</systemitem>
|
---|
| 206 | user):
|
---|
[852fc810] | 207 | </para>
|
---|
| 208 |
|
---|
[a42c273] | 209 | <screen role="root"
|
---|
| 210 | remap="doc"><userinput>install -d /usr/share/doc/gdb-&gdb-version; &&
|
---|
[03b05e7] | 211 | rm -rf gdb/doc/doxy/xml &&
|
---|
[852fc810] | 212 | cp -Rv gdb/doc/doxy /usr/share/doc/gdb-&gdb-version;</userinput></screen>
|
---|
| 213 |
|
---|
[4b0ebf70] | 214 | </sect2>
|
---|
[d3970e1] | 215 |
|
---|
[870e9f05] | 216 | <sect2 role="commands">
|
---|
| 217 | <title>Command Explanations</title>
|
---|
| 218 |
|
---|
| 219 | <para>
|
---|
| 220 | <parameter>--with-system-readline</parameter>: This switch forces
|
---|
| 221 | <application>GDB</application> to use the copy of
|
---|
| 222 | <application>Readline</application> installed in LFS.
|
---|
| 223 | </para>
|
---|
| 224 |
|
---|
[d38dc9a] | 225 | <para>
|
---|
| 226 | <parameter>--with-python=/usr/bin/python3</parameter>: This switch
|
---|
| 227 | forces <application>GDB</application> to use Python 3 installed
|
---|
[9533795] | 228 | in LFS. Remove this switch if you have installed
|
---|
| 229 | <xref linkend="python2"/> and want to use it instead of Python 3.
|
---|
[d38dc9a] | 230 | </para>
|
---|
| 231 |
|
---|
[870e9f05] | 232 | </sect2>
|
---|
| 233 |
|
---|
[4b0ebf70] | 234 | <sect2 role="content">
|
---|
| 235 | <title>Contents</title>
|
---|
| 236 |
|
---|
| 237 | <segmentedlist>
|
---|
| 238 | <segtitle>Installed Programs</segtitle>
|
---|
| 239 | <segtitle>Installed Library</segtitle>
|
---|
| 240 | <segtitle>Installed Directories</segtitle>
|
---|
| 241 |
|
---|
| 242 | <seglistitem>
|
---|
[4890200] | 243 | <seg>
|
---|
[6cd96df] | 244 | gcore, gdb and gdbserver
|
---|
[4890200] | 245 | </seg>
|
---|
| 246 | <seg>
|
---|
| 247 | libinproctrace.so
|
---|
| 248 | </seg>
|
---|
| 249 | <seg>
|
---|
[03b05e7] | 250 | /usr/{include,share}/gdb and /usr/share/doc/gdb-&gdb-version;
|
---|
[4890200] | 251 | </seg>
|
---|
[4b0ebf70] | 252 | </seglistitem>
|
---|
| 253 | </segmentedlist>
|
---|
| 254 |
|
---|
| 255 | <variablelist>
|
---|
| 256 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 257 | <?dbfo list-presentation="list"?>
|
---|
| 258 | <?dbhtml list-presentation="table"?>
|
---|
| 259 |
|
---|
[a55a187] | 260 | <varlistentry id="gcore">
|
---|
| 261 | <term><command>gcore</command></term>
|
---|
| 262 | <listitem>
|
---|
| 263 | <para>
|
---|
| 264 | generates a core dump of a running program.
|
---|
| 265 | </para>
|
---|
| 266 | <indexterm zone="gdb gcore">
|
---|
| 267 | <primary sortas="b-gcore">gcore</primary>
|
---|
| 268 | </indexterm>
|
---|
| 269 | </listitem>
|
---|
| 270 | </varlistentry>
|
---|
| 271 |
|
---|
[4b0ebf70] | 272 | <varlistentry id="gdb-prog">
|
---|
| 273 | <term><command>gdb</command></term>
|
---|
| 274 | <listitem>
|
---|
[d3970e1] | 275 | <para>
|
---|
| 276 | is the GNU Debugger.
|
---|
| 277 | </para>
|
---|
[4b0ebf70] | 278 | <indexterm zone="gdb gdb-prog">
|
---|
| 279 | <primary sortas="b-gdb-prog">gdb-prog</primary>
|
---|
| 280 | </indexterm>
|
---|
| 281 | </listitem>
|
---|
| 282 | </varlistentry>
|
---|
| 283 |
|
---|
| 284 | <varlistentry id="gdbserver">
|
---|
| 285 | <term><command>gdbserver</command></term>
|
---|
| 286 | <listitem>
|
---|
[d3970e1] | 287 | <para>
|
---|
[4890200] | 288 | is a remote server for the GNU debugger (it allows programs
|
---|
| 289 | to be debugged from a different machine).
|
---|
[d3970e1] | 290 | </para>
|
---|
[4b0ebf70] | 291 | <indexterm zone="gdb gdbserver">
|
---|
| 292 | <primary sortas="b-gdbserver">gdbserver</primary>
|
---|
| 293 | </indexterm>
|
---|
| 294 | </listitem>
|
---|
| 295 | </varlistentry>
|
---|
| 296 |
|
---|
| 297 | <varlistentry id="libinproctrace">
|
---|
[4890200] | 298 | <term><filename class="libraryfile">libinproctrace.so</filename></term>
|
---|
[4b0ebf70] | 299 | <listitem>
|
---|
[d3970e1] | 300 | <para>
|
---|
| 301 | contains functions for the in-process tracing agent. The agent
|
---|
| 302 | allows for installing fast tracepoints, listing static tracepoint
|
---|
| 303 | markers, probing static tracepoints markers, and starting trace
|
---|
| 304 | monitoring.
|
---|
| 305 | </para>
|
---|
[4b0ebf70] | 306 | <indexterm zone="gdb libinproctrace">
|
---|
| 307 | <primary sortas="c-libinproctrace">libinproctrace.so</primary>
|
---|
| 308 | </indexterm>
|
---|
| 309 | </listitem>
|
---|
[d3970e1] | 310 | </varlistentry>
|
---|
[4b0ebf70] | 311 |
|
---|
| 312 | </variablelist>
|
---|
| 313 |
|
---|
| 314 | </sect2>
|
---|
| 315 |
|
---|
| 316 | </sect1>
|
---|