我正在尝试使用 gdb 调试我的 C++ 应用程序,但是当我尝试打印任何变量“p var”时,我收到消息:
Could not find the frame base for function name.
但是,可以设置断点“break sourcefile:15”并单步执行源代码。
我在 OSX 10.9 上使用 gcc48 4.8.3 和编译器标志编译我的应用程序 -Wall -Wno-write-strings -std=c++11 -m64 -fopenmp -msse4.2 -O0 -g
。 gdb 的版本为“GNU gdb (GDB) 7.7.1”。
当我使用 lldb 进行调试时,一切似乎都工作正常。
你知道为什么 GDB 不工作吗?
最佳答案
我在 MacOS > 10.8 上遇到了同样的问题,并且有 2 年没有在 Mac 上使用 gdb+gcc,今天我通过在编译器选项中添加 -gdwarf-3
选项成功解决了这个问题它开始工作(使用自制软件安装 gcc 6,gdb 7.11)。 Eclipse+CDT 调试现在也可以工作了。
关于c++ - 使用 gdb : "Could not find the frame base", 进行调试失败,但使用 lldb 进行调试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25863893/