Install tools to debug applications

To analyze and troubleshoot internal application behavior, Red Hat Enterprise Linux offers multiple debugging and instrumentation tools.

Before you begin

  • The debug and source repositories is enabled.

Procedure

  1. Install the tools for debugging:
    # dnf install gdb valgrind systemtap ltrace strace
  2. Install the dnf-utils package to use the debuginfo-install tool:
    # dnf install dnf-utils
  3. Run a SystemTap helper script to prepare the environment:
    # stap-prep

    Note that stap-prep installs packages relevant to the currently running kernel, which might not be the same as the installed kernel. To ensure stap-prep installs the correct kernel-debuginfo and kernel-headers packages, double-check the current kernel version by using the uname -r command and reboot your system if necessary.

    Make sure SELinux policies allow the relevant applications to run not only normally, but in the debugging situations, too. For more information, see Using SELinux.