Cannot view std::string when compiled with clang

前端 未结 4 908
深忆病人
深忆病人 2021-02-12 13:38

g++ (GCC) 5.2.0

clang version 3.7.1 (tags/RELEASE_371/final)

GNU gdb (GDB) 7.12

Gdb is unable to locate the definition of std::string when compiled with

4条回答
  •  臣服心动
    2021-02-12 14:36

    clang trusts that debugging symbols for libstd++ are available, so you have to install them. See ks1322's answer for how to do that on Fedora. On Ubuntu, run:

    sudo apt-get install libstdc++6-dbgsym
    

    After that, things will just work.

    Do not define _GLIBCXX_DEBUG since that'll break libstdc++'s abi.

    -fno-limit-debug-info will make clang emit debug info that's larger than necessary, so I'd advise against that too. Just install the debug info package for libstdc++.

提交回复
热议问题