can not print global objects in gdb

前端 未结 1 1376
梦如初夏
梦如初夏 2020-12-21 04:00

I have this simple c++ code :

#include

using namespace std;
vector q;

int main()
{
    q.push_back(\"test1\");
    q.pus         


        
相关标签:
1条回答
  • 2020-12-21 04:30

    This issue is somehow related to new gcc Dual ABI, introduced in gcc 5. gdb has poor support of these new C++11 ABI tags. See these bugs for example:

    • https://sourceware.org/bugzilla/show_bug.cgi?id=19436
    • https://sourceware.org/bugzilla/show_bug.cgi?id=18601

    As a workaround you may disable this new gcc ABI by compiling with -D_GLIBCXX_USE_CXX11_ABI=0:

    g++ -D_GLIBCXX_USE_CXX11_ABI=0 -g a.cpp
    
    0 讨论(0)
提交回复
热议问题