I have built and installed GCC 4.8.1 from source:
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPP
Your gdb is too old -- you need a more recent gdb (I use 7.6) to understand the debugging info generated by gcc 4.8.1
Usually GCC uses dwarf as its main debugging file format, you need to enable dwarf support when building gcc with the flag --with-dwarf2
.
While building your compiled object you can use -ggdb
instead of -g
which is a more specific solution but just for gdb.