7.3. Running the GNU Debugger
scl enable devtoolset-4 'gdb file_name'
gdbdebugger in interactive mode and displays the default prompt,
(gdb). To quit the debugging session and return to the shell prompt, run the following command at any time:
sclutility, causing it to be run with the Red Hat Developer Toolset binaries used in preference to the Red Hat Enterprise Linux system equivalent. This allows you to run a shell session with Red Hat Developer Toolset
scl enable devtoolset-4 'bash'
gdbyou are using at any point, type the following at a shell prompt:
gdbexecutable path will begin with
/opt. Alternatively, you can use the following command to confirm that the version number matches that for Red Hat Developer Toolset
Example 7.3. Running the gdb Utility on the fibonacci Binary File
fibonaccibinary file as shown in Example 7.1, “Compiling a C Program With Debugging Information”, you can start debugging it with
gdbby typing the following at a shell prompt:
scl enable devtoolset-4 'gdb fibonacci'GNU gdb (GDB) Red Hat Enterprise Linux (7.10-20.el7) Copyright (C) 2015 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word". (gdb)