GDB-8.2.1

#### Beyond Linux® From Scratch - Version 2019-02-27

### Chapter 13. Programming

- Prev

  GC-8.0.2

- Next

  Git-2.20.1

- Up
- Home

# GDB-8.2.1

## Introduction to GDB

GDB, the GNU Project debugger, allows you to see what is going on “inside” another program while it executes -- or what another program was doing at the moment it crashed. Note that GDB is most effective when tracing programs and libraries that were built with debugging symbols and not stripped.

This package is known to build and work properly using an LFS-8.4 platform.

### Package Information

- Download (HTTP): https://ftp.gnu.org/gnu/gdb/gdb-8.2.1.tar.xz

- Download (FTP): ftp://ftp.gnu.org/gnu/gdb/gdb-8.2.1.tar.xz

- Download MD5 sum: f8b2562e830a4098dd5b5ea9e9296c70

- Download size: 19 MB

- Estimated disk space required: 599 MB (add 55 MB for tests, add 723 MB for docs)

- Estimated build time: 1.8 SBU (Using parallelism=4; add 66 SBU for tests, add 0.6 SBU for docs)

### GDB Dependencies

#### Optional

DejaGnu-1.6.2 (required for tests), Doxygen-1.8.15, GCC-8.2.0 (ada and gfortran are used for tests), Guile-2.2.4, Python-2.7.15, rustc-1.32.0 (used for some tests), Valgrind-3.14.0, and SystemTap (run-time, used for tests)

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/gdb

## Installation of GDB

Install GDB by running the following commands:

    ./configure --prefix=/usr --with-system-readline &&
    make

Optionally, to build the API documentation using Doxygen-1.8.15, run:

    make -C gdb/doc doxy

To test the results, issue:

    pushd gdb/testsuite &&
    make  site.exp      &&
    echo  "set gdb_test_timeout 120" >> site.exp &&
    runtest
    popd

See gdb/testsuite/README and TestingGDB. There are many problems with the test suite:

- Clean directories are needed if re-running the tests. For that reason, it is recommended to make a copy of the compiled source code directory before the tests in case you need to run the tests again.

- Results depend on installed compilers.

- There are a large number of timeouts (there is a variable that can be set to increase time for timeout, but changing it will result in a different number of tests being run).

- There are failures associated with system readline 6.x.

- A few tests assume that the header file `<sys/sdt.h>`, part of SystemTap, is present.

- Approximately 1-3% of the tests fail (out of over 56000 tests).

Now, as the `root` user:

    make -C gdb install

If you have built the API documentation, it is now in gdb/doc/doxy. You can install it (as the `root` user):

    install -d /usr/share/doc/gdb-8.2.1 &&
    rm -rf gdb/doc/doxy/xml &&
    cp -Rv gdb/doc/doxy /usr/share/doc/gdb-8.2.1

## Command Explanations

`--with-system-readline`: This switch forces GDB to use the copy of Readline installed in LFS.

## Contents

Installed Programs: gcore, gdb and gdbserver
Installed Library: libinproctrace.so
Installed Directories: /usr/{include,share}/gdb and /usr/share/doc/gdb-8.2.1

### Short Descriptions

gcore | generates a core dump of a running program.
gdb | is the GNU Debugger.
gdbserver | is a remote server for the GNU debugger (it allows programs to be debugged from a different machine).
`libinproctrace.so` | contains functions for the in-process tracing agent. The agent allows for installing fast tracepoints, listing static tracepoint markers, probing static tracepoints markers, and starting trace monitoring.

Last updated on 2019-02-15 22:56:11 -0600

- Prev

  GC-8.0.2

- Next

  Git-2.20.1

- Up
- Home