Install gdb-source by entering the following commands in the terminal:
sudo apt update sudo apt install gdb-source
Description:
GNU Debugger (source)
GDB is a source-level debugger, capable of breaking programs at any specific line, displaying variable values, and determining where errors occurred. Currently, gdb supports C, C++, D, Objective-C, Fortran, Java, OpenCL C, Pascal, assembly, Modula-2, Go, and Ada. A must-have for any serious programmer. . This package contains the sources and patches which are needed to build GDB.
Homepage: http://www.gnu.org/s/gdb/
Version: 8.1-0ubuntu3
Section: universe/devel