[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 |
|
---|
[99c32731] | 7 | <!ENTITY gdb-download-http "https://ftp.gnu.org/gnu/gdb/gdb-&gdb-version;.tar.xz">
|
---|
[d81eda8] | 8 | <!ENTITY gdb-download-ftp "ftp://ftp.gnu.org/gnu/gdb/gdb-&gdb-version;.tar.xz">
|
---|
[fcabde3c] | 9 | <!ENTITY gdb-md5sum "39e654460c9cdd80200a29ac020cfe11">
|
---|
[0b8d9023] | 10 | <!ENTITY gdb-size "18 MB">
|
---|
[fcabde3c] | 11 | <!ENTITY gdb-buildsize "419 MB (additional 349 MB for tests)">
|
---|
| 12 | <!ENTITY gdb-time "2.4 SBU (add up to 7.8 SBU for tests)">
|
---|
[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 |
|
---|
[ccd74eb] | 41 | &lfs78_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">
|
---|
[d81eda8] | 81 | <xref linkend="dejagnu"/> (for tests),
|
---|
[852fc810] | 82 | <xref linkend="doxygen"/>,
|
---|
[03b05e7] | 83 | <xref linkend="guile"/>,
|
---|
[2029b72] | 84 | <xref linkend="python2"/>,
|
---|
| 85 | <xref linkend="valgrind"/>, and
|
---|
| 86 | <ulink url="https://sourceware.org/systemtap/">SystemTap</ulink>
|
---|
| 87 | (run-time dependency, also used in a few tests)
|
---|
[d4c9b7c] | 88 | </para>
|
---|
| 89 |
|
---|
[4b0ebf70] | 90 | <para condition="html" role="usernotes">User Notes:
|
---|
[d3970e1] | 91 | <ulink url="&blfs-wiki;/gdb"/>
|
---|
| 92 | </para>
|
---|
[4b0ebf70] | 93 | </sect2>
|
---|
| 94 |
|
---|
| 95 | <sect2 role="installation">
|
---|
[d3970e1] | 96 | <title>Installation of GDB</title>
|
---|
[4b0ebf70] | 97 |
|
---|
[d3970e1] | 98 | <para>
|
---|
| 99 | Install <application>GDB</application> by running the following
|
---|
| 100 | commands:
|
---|
| 101 | </para>
|
---|
[4b0ebf70] | 102 |
|
---|
[a55a187] | 103 | <screen><userinput>./configure --prefix=/usr --with-system-readline &&
|
---|
[4b0ebf70] | 104 | make</userinput></screen>
|
---|
| 105 |
|
---|
[46fd248] | 106 | <para>
|
---|
| 107 | Optionally, to build the API documentation using
|
---|
| 108 | <xref linkend="doxygen"/>, run:
|
---|
| 109 | </para>
|
---|
| 110 |
|
---|
| 111 | <screen><userinput>make -C gdb/doc doxy</userinput></screen>
|
---|
| 112 |
|
---|
[d3970e1] | 113 | <para>
|
---|
[03b05e7] | 114 | To test the results, issue:
|
---|
| 115 | </para>
|
---|
| 116 |
|
---|
| 117 | <screen><userinput>pushd gdb/testsuite &&
|
---|
| 118 | make site.exp &&
|
---|
| 119 | echo "set gdb_test_timeout 120" >> site.exp &&
|
---|
| 120 | runtest TRANSCRIPT=y
|
---|
| 121 | popd</userinput></screen>
|
---|
| 122 |
|
---|
| 123 | <para>
|
---|
| 124 | See <emphasis>gdb/testsuite/README</emphasis> and <ulink
|
---|
| 125 | url="https://sourceware.org/gdb/wiki/TestingGDB">TestingGDB</ulink>.
|
---|
| 126 | There are many problems with the test suite. First one is that you need
|
---|
| 127 | to clean some directories, if re-running the tests. For that reason, it
|
---|
| 128 | is recommended to make a copy of the compiled source code directory,
|
---|
| 129 | before the tests, in case you need to run the tests again. Results depend
|
---|
| 130 | on installed compilers, there are differences if run locally or remotely,
|
---|
| 131 | a large number of timeouts (there is a variable that can be set to
|
---|
| 132 | increase time for timeout, but changing it, apparently the total number
|
---|
| 133 | of tests is not conserved), there are failures associated with system
|
---|
[2029b72] | 134 | readline 6.x, between others. A few tests assume that the header file
|
---|
| 135 | <filename><sys/sdt.h></filename>, part of <ulink
|
---|
| 136 | url="https://sourceware.org/systemtap/">SystemTap</ulink>, is present.
|
---|
| 137 | Unexpected failures are less than 0.3%.
|
---|
[d3970e1] | 138 | </para>
|
---|
[4b0ebf70] | 139 |
|
---|
[d3970e1] | 140 | <para>
|
---|
| 141 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 142 | </para>
|
---|
[4b0ebf70] | 143 |
|
---|
| 144 | <screen role="root"><userinput>make -C gdb install</userinput></screen>
|
---|
| 145 |
|
---|
[852fc810] | 146 | <para>
|
---|
[46fd248] | 147 | If you have built the API documentation, it is now in gdb/doc/doxy.
|
---|
| 148 | You can install it (as the <systemitem class="username">root</systemitem>
|
---|
| 149 | user):
|
---|
[852fc810] | 150 | </para>
|
---|
| 151 |
|
---|
| 152 | <screen role="root"><userinput>install -d /usr/share/doc/gdb-&gdb-version; &&
|
---|
[03b05e7] | 153 | rm -rf gdb/doc/doxy/xml &&
|
---|
[852fc810] | 154 | cp -Rv gdb/doc/doxy /usr/share/doc/gdb-&gdb-version;</userinput></screen>
|
---|
| 155 |
|
---|
[4b0ebf70] | 156 | </sect2>
|
---|
[d3970e1] | 157 |
|
---|
[4b0ebf70] | 158 | <sect2 role="content">
|
---|
| 159 | <title>Contents</title>
|
---|
| 160 |
|
---|
| 161 | <segmentedlist>
|
---|
| 162 | <segtitle>Installed Programs</segtitle>
|
---|
| 163 | <segtitle>Installed Library</segtitle>
|
---|
| 164 | <segtitle>Installed Directories</segtitle>
|
---|
| 165 |
|
---|
| 166 | <seglistitem>
|
---|
[4890200] | 167 | <seg>
|
---|
[6cd96df] | 168 | gcore, gdb and gdbserver
|
---|
[4890200] | 169 | </seg>
|
---|
| 170 | <seg>
|
---|
| 171 | libinproctrace.so
|
---|
| 172 | </seg>
|
---|
| 173 | <seg>
|
---|
[03b05e7] | 174 | /usr/{include,share}/gdb and /usr/share/doc/gdb-&gdb-version;
|
---|
[4890200] | 175 | </seg>
|
---|
[4b0ebf70] | 176 | </seglistitem>
|
---|
| 177 | </segmentedlist>
|
---|
| 178 |
|
---|
| 179 | <variablelist>
|
---|
| 180 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 181 | <?dbfo list-presentation="list"?>
|
---|
| 182 | <?dbhtml list-presentation="table"?>
|
---|
| 183 |
|
---|
[a55a187] | 184 | <varlistentry id="gcore">
|
---|
| 185 | <term><command>gcore</command></term>
|
---|
| 186 | <listitem>
|
---|
| 187 | <para>
|
---|
| 188 | generates a core dump of a running program.
|
---|
| 189 | </para>
|
---|
| 190 | <indexterm zone="gdb gcore">
|
---|
| 191 | <primary sortas="b-gcore">gcore</primary>
|
---|
| 192 | </indexterm>
|
---|
| 193 | </listitem>
|
---|
| 194 | </varlistentry>
|
---|
| 195 |
|
---|
[4b0ebf70] | 196 | <varlistentry id="gdb-prog">
|
---|
| 197 | <term><command>gdb</command></term>
|
---|
| 198 | <listitem>
|
---|
[d3970e1] | 199 | <para>
|
---|
| 200 | is the GNU Debugger.
|
---|
| 201 | </para>
|
---|
[4b0ebf70] | 202 | <indexterm zone="gdb gdb-prog">
|
---|
| 203 | <primary sortas="b-gdb-prog">gdb-prog</primary>
|
---|
| 204 | </indexterm>
|
---|
| 205 | </listitem>
|
---|
| 206 | </varlistentry>
|
---|
| 207 |
|
---|
| 208 | <varlistentry id="gdbserver">
|
---|
| 209 | <term><command>gdbserver</command></term>
|
---|
| 210 | <listitem>
|
---|
[d3970e1] | 211 | <para>
|
---|
[4890200] | 212 | is a remote server for the GNU debugger (it allows programs
|
---|
| 213 | to be debugged from a different machine).
|
---|
[d3970e1] | 214 | </para>
|
---|
[4b0ebf70] | 215 | <indexterm zone="gdb gdbserver">
|
---|
| 216 | <primary sortas="b-gdbserver">gdbserver</primary>
|
---|
| 217 | </indexterm>
|
---|
| 218 | </listitem>
|
---|
| 219 | </varlistentry>
|
---|
| 220 |
|
---|
| 221 | <varlistentry id="libinproctrace">
|
---|
[4890200] | 222 | <term><filename class="libraryfile">libinproctrace.so</filename></term>
|
---|
[4b0ebf70] | 223 | <listitem>
|
---|
[d3970e1] | 224 | <para>
|
---|
| 225 | contains functions for the in-process tracing agent. The agent
|
---|
| 226 | allows for installing fast tracepoints, listing static tracepoint
|
---|
| 227 | markers, probing static tracepoints markers, and starting trace
|
---|
| 228 | monitoring.
|
---|
| 229 | </para>
|
---|
[4b0ebf70] | 230 | <indexterm zone="gdb libinproctrace">
|
---|
| 231 | <primary sortas="c-libinproctrace">libinproctrace.so</primary>
|
---|
| 232 | </indexterm>
|
---|
| 233 | </listitem>
|
---|
[d3970e1] | 234 | </varlistentry>
|
---|
[4b0ebf70] | 235 |
|
---|
| 236 | </variablelist>
|
---|
| 237 |
|
---|
| 238 | </sect2>
|
---|
| 239 |
|
---|
| 240 | </sect1>
|
---|