c - GDB says "no symbol table," but nm shows file has debug symbols

ID : 274498

viewed : 49

Tags : cdebugginggccgdbc





Top 4 Answer for c - GDB says "no symbol table," but nm shows file has debug symbols

vote vote

90

gcc 4.8.1 generates dwarf4 debug info which gdb 7.4 can't understand. You need to install gdb 7.6

vote vote

85

In addition to Chris Dodd's answer, you can also compile your code with gcc -gdwarf-3, which compiles with dwarf3 debug info. Which is compatible with your GDB version.

vote vote

70

gdb read .debug_info section before .symtab .dynsym.

nm just read .symtab .dynsym.

It's because that the .debug_info section in your ELF file was striped.

You can use:

readelf -S youelf | grep -i debug 

to check wether debug_info is present.

vote vote

67

Top 3 video Explaining c - GDB says "no symbol table," but nm shows file has debug symbols







Related QUESTION?