无法在Mac OSX上运行Qt调试器

时间:2014-09-08 19:40:39

标签: macos qt debugging

尝试在Mac上调试用Qt编写的应用程序(10.6.8)。 Qt 4.8.6,QtCreator 3.2.0,我在/usr/bin/gdb和编译器gcc-4.2上设置了调试器System GDB

我想调试代码......

我进入了应用程序输出窗口

Debugging starts
Debugging has failed
Debugging has finished

(没有破坏点,代码中没有任何内容)

我打开了调试日志窗口,我看到的唯一可疑的东西是

....
    111^error,msg="Undefined command: \"python\". Try \"help\*.*
    NOTE: ENGINE SETUP FAILED
    State Changed From EngineSetupRequested(1) to EngineSetupFailed(2)
    HANDLE RUNCONTROL FINISHED
    .....

在左侧,部分命令有

109-interpreter-exec console "python sys.path.insert(1, "/Volumes/QtCreator/..."
110-interpreter-exec console "python sys.path.append("/usr/bin/data-directory/ python)"
111-interpreter-exec console "python from gdbbridge import *"

我检查了python已安装...我可以从任何地方输入python并获取其命令提示符,以便它在系统路径上...

我读过一些关于必须签署fsf调试器的内容,但我使用的是不是fsf调试器?

如何在macx中调试我的应用程序?

编辑:从命令行尝试gdb,将app作为参数

GNU gdb 6.3.50-20050815 (Apple version gdb-1518) (Sat Feb 12 02:52:12 UTC 2011)
...
This GDB was configured as "x86_64-apple-darwin"...
warning: Unable to read symbols for QtSvg.framework/Versions/4/QtSvg (file not found).
warning: Unable to read symbols from "QtSvg" (not yet mapped into memory).
warning: Unable to read symbols for QtGui.framework/Versions/4/QtGui (file not found).
warning: Unable to read symbols from "QtGui" (not yet mapped into memory).
warning: Unable to read symbols for QtCore.framework/Versions/4/QtCore (file not found).
warning: Unable to read symbols from "QtCore" (not yet mapped into memory).
warning: Unable to read symbols for QtNetwork.framework/Versions/4/QtNetwork (file not found).
warning: Unable to read symbols from "QtNetwork" (not yet mapped into memory).
Reading symbols for shared libraries .
... some warnings that .o is more recent than .dylib in dependent libs... but that I don't have to step into so I don't care...
...
warning: Could not find object file "/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/x86_64/crt3.o" - no debug information available for "darwin-crt3.c".
.... done

所以我输入了

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x00007fff83872c00 in strlen ()

我不知道那是哪一个(我确实看不到它)或者它是一个实际的字符串指针还是其他东西......

我不知道断点在哪里,整个源很长并且包含很多很多文件所以我真的不知道如何用命令行中的gdb来做...

但它似乎已经开始了,没有抱怨python?

开始时的警告 - 可能意味着仍有希望,如果它了解到它的库,有可能以某种方式配置gdb与Qt一起运行吗?

顺便说一下......寻找丢失的图书馆...... QT 4.8.4 debug libraries not found on Mac OSX

我尝试使用lldb和qmake替换我的调试器(在Qt中) - 在这两种情况下我都收到错误“无法创建”无引擎“类型的调试器引擎”

编辑:我读到的另一个建议是重新编译Qt Creator二进制文件以添加调试符号...我希望这不是我必须做的,因为

“注意:使用Qt Creator 3.2,我们不再支持OS X 10.6(Snow Leopard)。技术原因是Apple不支持该操作系统版本上的任何类型的C ++ 11。当然,这不是影响你可以运行你的Qt应用程序的平台。但是不可能在10.6上运行Qt Creator 3.2二进制文件,也不可能用Apple提供的工具链在10.6上编译Qt Creator 3.2。“ (来自发行说明)

更新:我能够通过放置zillion qDebug()语句找到上述错误的原因(KERN_INVALID_ADDRESS)......虽然这不是我想要完成的,但是许多错误。

我仍然有很多错误......附加一个调试器会很棒。我列出了程序所需的库 - 它们似乎存在。不确定它们是“调试”还是“发布”库。 ....但我并没有试图逐步完成Qt源代码,那么为什么我有调试符号呢?如果它们是“释放”类型的库,那么我的整个程序,构建在“调试”,将不会执行甚至无法构建?由于我在“调试”模式下构建代码并执行,因此库必须正确,对吧?

令人困惑......

1 个答案:

答案 0 :(得分:0)

QtCreator 3.2(以及之前的几个版本)需要启用Python脚本(或Windows上的LLDB或CDB)的GDB。在Mac上,Apple的GDB没有Python脚本,因此无法与Qt Creator一起使用。 FSF GDB适用于Mac上的某些项目,但一般来说LLDB更适合。

你的" GNU gdb 6.3.50-20050815(Apple版gdb-1518)"是一个非Python的Apple版本。

相关问题