Cannot evaluate function — may be inlined

后端 未结 2 1825
既然无缘
既然无缘 2021-01-01 13:44

I wrote a function similar to this:

class abc {
    private :
    int m_var ;
    public :
    int func() { return m_var ; }
};

When I try

2条回答
  •  -上瘾入骨i
    2021-01-01 14:27

    When the function is inlined, it doesn't appear as a proper symbol in the executable, so there's no way for gdb to execute it. The simplest thing to do is probably to compile with function inlining disabled, either by -fno-inline-functions or (still better) -O0.

提交回复
热议问题