[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">
|
---|
[5d46d331] | 9 | <!ENTITY gdb-md5sum "b5a49dbff00d9a87fbe114d14b3101c0">
|
---|
[c780991] | 10 | <!ENTITY gdb-size "19 MB">
|
---|
[5d46d331] | 11 | <!ENTITY gdb-buildsize "600 MB (add 59 MB for tests, add 728 MB for docs)">
|
---|
| 12 | <!ENTITY gdb-time "1.8 SBU (Using parallelism=4; add 65 SBU for tests, add 0.6 SBU for docs)">
|
---|
[4b0ebf70] | 13 | ]>
|
---|
| 14 |
|
---|
[d3970e1] | 15 | <sect1 id="gdb" xreflabel="GDB-&gdb-version;">
|
---|
[4b0ebf70] | 16 | <?dbhtml filename="gdb.html"?>
|
---|
| 17 |
|
---|
| 18 | <sect1info>
|
---|
| 19 | <othername>$LastChangedBy$</othername>
|
---|
| 20 | <date>$Date$</date>
|
---|
| 21 | </sect1info>
|
---|
| 22 |
|
---|
[d3970e1] | 23 | <title>GDB-&gdb-version;</title>
|
---|
[4b0ebf70] | 24 |
|
---|
| 25 | <indexterm zone="gdb">
|
---|
[4890200] | 26 | <primary sortas="a-GDB">GDB</primary>
|
---|
[4b0ebf70] | 27 | </indexterm>
|
---|
| 28 |
|
---|
| 29 | <sect2 role="package">
|
---|
[d3970e1] | 30 | <title>Introduction to GDB</title>
|
---|
| 31 |
|
---|
| 32 | <para>
|
---|
| 33 | <application>GDB</application>, the GNU Project debugger, allows you
|
---|
| 34 | to see what is going on <quote>inside</quote> another program while it
|
---|
| 35 | executes -- or what another program was doing at the moment it crashed.
|
---|
| 36 | Note that <application>GDB</application> is most effective when tracing
|
---|
| 37 | programs and libraries that were built with debugging symbols and not
|
---|
| 38 | stripped.
|
---|
| 39 | </para>
|
---|
[4b0ebf70] | 40 |
|
---|
[51cb7cd] | 41 | &lfs83_checked;
|
---|
[4b0ebf70] | 42 |
|
---|
| 43 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 44 | <itemizedlist spacing="compact">
|
---|
| 45 | <listitem>
|
---|
[4890200] | 46 | <para>
|
---|
| 47 | Download (HTTP): <ulink url="&gdb-download-http;"/>
|
---|
| 48 | </para>
|
---|
[4b0ebf70] | 49 | </listitem>
|
---|
| 50 | <listitem>
|
---|
[4890200] | 51 | <para>
|
---|
| 52 | Download (FTP): <ulink url="&gdb-download-ftp;"/>
|
---|
| 53 | </para>
|
---|
[4b0ebf70] | 54 | </listitem>
|
---|
| 55 | <listitem>
|
---|
[4890200] | 56 | <para>
|
---|
| 57 | Download MD5 sum: &gdb-md5sum;
|
---|
| 58 | </para>
|
---|
[4b0ebf70] | 59 | </listitem>
|
---|
| 60 | <listitem>
|
---|
[4890200] | 61 | <para>
|
---|
| 62 | Download size: &gdb-size;
|
---|
| 63 | </para>
|
---|
[4b0ebf70] | 64 | </listitem>
|
---|
| 65 | <listitem>
|
---|
[4890200] | 66 | <para>
|
---|
| 67 | Estimated disk space required: &gdb-buildsize;
|
---|
| 68 | </para>
|
---|
[4b0ebf70] | 69 | </listitem>
|
---|
| 70 | <listitem>
|
---|
[4890200] | 71 | <para>
|
---|
| 72 | Estimated build time: &gdb-time;
|
---|
| 73 | </para>
|
---|
[4b0ebf70] | 74 | </listitem>
|
---|
| 75 | </itemizedlist>
|
---|
| 76 |
|
---|
[d3970e1] | 77 | <bridgehead renderas="sect3">GDB Dependencies</bridgehead>
|
---|
[d4c9b7c] | 78 |
|
---|
| 79 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 80 | <para role="optional">
|
---|
[51cb7cd] | 81 | <xref linkend="dejagnu"/> (required for tests),
|
---|
[852fc810] | 82 | <xref linkend="doxygen"/>,
|
---|
[51cb7cd] | 83 | <xref linkend="gcc"/> (ada and gfortran are used for tests),
|
---|
| 84 | <xref linkend="guile"/>,
|
---|
[2029b72] | 85 | <xref linkend="python2"/>,
|
---|
[51cb7cd] | 86 | <xref linkend="rust"/> (used for some tests),
|
---|
[2029b72] | 87 | <xref linkend="valgrind"/>, and
|
---|
| 88 | <ulink url="https://sourceware.org/systemtap/">SystemTap</ulink>
|
---|
[51cb7cd] | 89 | (run-time, used for tests)
|
---|
[d4c9b7c] | 90 | </para>
|
---|
| 91 |
|
---|
[4b0ebf70] | 92 | <para condition="html" role="usernotes">User Notes:
|
---|
[d3970e1] | 93 | <ulink url="&blfs-wiki;/gdb"/>
|
---|
| 94 | </para>
|
---|
[4b0ebf70] | 95 | </sect2>
|
---|
| 96 |
|
---|
| 97 | <sect2 role="installation">
|
---|
[d3970e1] | 98 | <title>Installation of GDB</title>
|
---|
[4b0ebf70] | 99 |
|
---|
[d3970e1] | 100 | <para>
|
---|
| 101 | Install <application>GDB</application> by running the following
|
---|
| 102 | commands:
|
---|
| 103 | </para>
|
---|
[4b0ebf70] | 104 |
|
---|
[51cb7cd] | 105 | <screen><userinput>./configure --prefix=/usr --with-system-readline &&
|
---|
[4b0ebf70] | 106 | make</userinput></screen>
|
---|
| 107 |
|
---|
[46fd248] | 108 | <para>
|
---|
| 109 | Optionally, to build the API documentation using
|
---|
| 110 | <xref linkend="doxygen"/>, run:
|
---|
| 111 | </para>
|
---|
| 112 |
|
---|
| 113 | <screen><userinput>make -C gdb/doc doxy</userinput></screen>
|
---|
| 114 |
|
---|
[d3970e1] | 115 | <para>
|
---|
[03b05e7] | 116 | To test the results, issue:
|
---|
| 117 | </para>
|
---|
| 118 |
|
---|
| 119 | <screen><userinput>pushd gdb/testsuite &&
|
---|
| 120 | make site.exp &&
|
---|
| 121 | echo "set gdb_test_timeout 120" >> site.exp &&
|
---|
| 122 | runtest TRANSCRIPT=y
|
---|
| 123 | popd</userinput></screen>
|
---|
| 124 |
|
---|
| 125 | <para>
|
---|
| 126 | See <emphasis>gdb/testsuite/README</emphasis> and <ulink
|
---|
| 127 | url="https://sourceware.org/gdb/wiki/TestingGDB">TestingGDB</ulink>.
|
---|
[39e42c88] | 128 | There are many problems with the test suite:
|
---|
[d3970e1] | 129 | </para>
|
---|
[39e42c88] | 130 |
|
---|
| 131 | <itemizedlist>
|
---|
| 132 | <listitem>
|
---|
| 133 | <para>
|
---|
[3e42104] | 134 | Clean directories are needed if re-running the tests. For that
|
---|
[39e42c88] | 135 | reason, it is recommended to make a copy of the compiled source code
|
---|
| 136 | directory before the tests in case you need to run the tests again.
|
---|
| 137 | </para>
|
---|
| 138 | </listitem>
|
---|
| 139 |
|
---|
| 140 | <listitem>
|
---|
| 141 | <para>
|
---|
| 142 | Results depend on installed compilers.
|
---|
| 143 | </para>
|
---|
| 144 | </listitem>
|
---|
| 145 |
|
---|
[3e42104] | 146 | <!-- They worked fine for me. [renodr] 7.11.1 -->
|
---|
| 147 |
|
---|
| 148 | <!--
|
---|
[39e42c88] | 149 | <listitem>
|
---|
| 150 | <para>
|
---|
| 151 | If run remotely over an ssh connection, the tests will hang
|
---|
[0639bb6] | 152 | and require a hard (power cycle) reset of the system.
|
---|
[39e42c88] | 153 | </para>
|
---|
| 154 | </listitem>
|
---|
[3e42104] | 155 | -->
|
---|
[39e42c88] | 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>
|
---|
| 180 |
|
---|
| 181 | <listitem>
|
---|
| 182 | <para>
|
---|
[51cb7cd] | 183 | Approximately 1-3% of the tests fail (out of over 53000 tests).
|
---|
[39e42c88] | 184 | </para>
|
---|
| 185 | </listitem>
|
---|
| 186 |
|
---|
| 187 | </itemizedlist>
|
---|
[4b0ebf70] | 188 |
|
---|
[d3970e1] | 189 | <para>
|
---|
| 190 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 191 | </para>
|
---|
[4b0ebf70] | 192 |
|
---|
| 193 | <screen role="root"><userinput>make -C gdb install</userinput></screen>
|
---|
| 194 |
|
---|
[852fc810] | 195 | <para>
|
---|
[46fd248] | 196 | If you have built the API documentation, it is now in gdb/doc/doxy.
|
---|
| 197 | You can install it (as the <systemitem class="username">root</systemitem>
|
---|
| 198 | user):
|
---|
[852fc810] | 199 | </para>
|
---|
| 200 |
|
---|
| 201 | <screen role="root"><userinput>install -d /usr/share/doc/gdb-&gdb-version; &&
|
---|
[03b05e7] | 202 | rm -rf gdb/doc/doxy/xml &&
|
---|
[852fc810] | 203 | cp -Rv gdb/doc/doxy /usr/share/doc/gdb-&gdb-version;</userinput></screen>
|
---|
| 204 |
|
---|
[4b0ebf70] | 205 | </sect2>
|
---|
[d3970e1] | 206 |
|
---|
[870e9f05] | 207 | <sect2 role="commands">
|
---|
| 208 | <title>Command Explanations</title>
|
---|
| 209 |
|
---|
| 210 | <para>
|
---|
| 211 | <parameter>--with-system-readline</parameter>: This switch forces
|
---|
| 212 | <application>GDB</application> to use the copy of
|
---|
| 213 | <application>Readline</application> installed in LFS.
|
---|
| 214 | </para>
|
---|
| 215 |
|
---|
| 216 | </sect2>
|
---|
| 217 |
|
---|
[4b0ebf70] | 218 | <sect2 role="content">
|
---|
| 219 | <title>Contents</title>
|
---|
| 220 |
|
---|
| 221 | <segmentedlist>
|
---|
| 222 | <segtitle>Installed Programs</segtitle>
|
---|
| 223 | <segtitle>Installed Library</segtitle>
|
---|
| 224 | <segtitle>Installed Directories</segtitle>
|
---|
| 225 |
|
---|
| 226 | <seglistitem>
|
---|
[4890200] | 227 | <seg>
|
---|
[6cd96df] | 228 | gcore, gdb and gdbserver
|
---|
[4890200] | 229 | </seg>
|
---|
| 230 | <seg>
|
---|
| 231 | libinproctrace.so
|
---|
| 232 | </seg>
|
---|
| 233 | <seg>
|
---|
[03b05e7] | 234 | /usr/{include,share}/gdb and /usr/share/doc/gdb-&gdb-version;
|
---|
[4890200] | 235 | </seg>
|
---|
[4b0ebf70] | 236 | </seglistitem>
|
---|
| 237 | </segmentedlist>
|
---|
| 238 |
|
---|
| 239 | <variablelist>
|
---|
| 240 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 241 | <?dbfo list-presentation="list"?>
|
---|
| 242 | <?dbhtml list-presentation="table"?>
|
---|
| 243 |
|
---|
[a55a187] | 244 | <varlistentry id="gcore">
|
---|
| 245 | <term><command>gcore</command></term>
|
---|
| 246 | <listitem>
|
---|
| 247 | <para>
|
---|
| 248 | generates a core dump of a running program.
|
---|
| 249 | </para>
|
---|
| 250 | <indexterm zone="gdb gcore">
|
---|
| 251 | <primary sortas="b-gcore">gcore</primary>
|
---|
| 252 | </indexterm>
|
---|
| 253 | </listitem>
|
---|
| 254 | </varlistentry>
|
---|
| 255 |
|
---|
[4b0ebf70] | 256 | <varlistentry id="gdb-prog">
|
---|
| 257 | <term><command>gdb</command></term>
|
---|
| 258 | <listitem>
|
---|
[d3970e1] | 259 | <para>
|
---|
| 260 | is the GNU Debugger.
|
---|
| 261 | </para>
|
---|
[4b0ebf70] | 262 | <indexterm zone="gdb gdb-prog">
|
---|
| 263 | <primary sortas="b-gdb-prog">gdb-prog</primary>
|
---|
| 264 | </indexterm>
|
---|
| 265 | </listitem>
|
---|
| 266 | </varlistentry>
|
---|
| 267 |
|
---|
| 268 | <varlistentry id="gdbserver">
|
---|
| 269 | <term><command>gdbserver</command></term>
|
---|
| 270 | <listitem>
|
---|
[d3970e1] | 271 | <para>
|
---|
[4890200] | 272 | is a remote server for the GNU debugger (it allows programs
|
---|
| 273 | to be debugged from a different machine).
|
---|
[d3970e1] | 274 | </para>
|
---|
[4b0ebf70] | 275 | <indexterm zone="gdb gdbserver">
|
---|
| 276 | <primary sortas="b-gdbserver">gdbserver</primary>
|
---|
| 277 | </indexterm>
|
---|
| 278 | </listitem>
|
---|
| 279 | </varlistentry>
|
---|
| 280 |
|
---|
| 281 | <varlistentry id="libinproctrace">
|
---|
[4890200] | 282 | <term><filename class="libraryfile">libinproctrace.so</filename></term>
|
---|
[4b0ebf70] | 283 | <listitem>
|
---|
[d3970e1] | 284 | <para>
|
---|
| 285 | contains functions for the in-process tracing agent. The agent
|
---|
| 286 | allows for installing fast tracepoints, listing static tracepoint
|
---|
| 287 | markers, probing static tracepoints markers, and starting trace
|
---|
| 288 | monitoring.
|
---|
| 289 | </para>
|
---|
[4b0ebf70] | 290 | <indexterm zone="gdb libinproctrace">
|
---|
| 291 | <primary sortas="c-libinproctrace">libinproctrace.so</primary>
|
---|
| 292 | </indexterm>
|
---|
| 293 | </listitem>
|
---|
[d3970e1] | 294 | </varlistentry>
|
---|
[4b0ebf70] | 295 |
|
---|
| 296 | </variablelist>
|
---|
| 297 |
|
---|
| 298 | </sect2>
|
---|
| 299 |
|
---|
| 300 | </sect1>
|
---|