weird gdb message when debugging C++ program

前端 未结 2 579
执念已碎
执念已碎 2020-12-06 13:52

I use the apple\'s gdb, version as follow

GNU gdb 6.3.50-20050815 (Apple version gdb-1344) (Fri Jul  3 01:19:56 UTC 2009)
Copyright 2004 Free Software Founda         


        
相关标签:
2条回答
  • 2020-12-06 14:11

    http://gcc.gnu.org/gcc-4.5/changes.html says

    GCC now generates unwind info also for epilogues. DWARF debuginfo generated by GCC now uses more features of DWARF3 than before, and also some DWARF4 features. GDB older than 7.0 is not able to handle either of these, so to debug GCC 4.5 generated binaries or libraries GDB 7.0 or later is needed. You can disable use of DWARF4 features with the -gdwarf-3 -gstrict-dwarf options, or use -gdwarf-2 -gstrict-dwarf to restrict GCC to just DWARF2, but epilogue unwind info is emitted unconditionally whenever unwind info is emitted.

    But you already knew that, because everyone reads the release notes when they upgrade their compiler, right?! ;-)

    0 讨论(0)
  • 2020-12-06 14:18

    The version of GDB you're using (Apple's version) doesn't seem to support the newer features of the compiler you installed from macports.

    The error message is reporting that GDB doesn't understand some of the debugging information it's encountered in the program. The debugging information it has shown is a C++11 feature.

    The solution is to either upgrade to a newer GDB (probably from macports if there's one there), not use the features that GDB doesn't understand, or accept that the version of GDB you have won't be able to understand this.

    0 讨论(0)
提交回复
热议问题