【问题标题】:Can't get Qt to find the debugging helper无法让 Qt 找到调试助手
【发布时间】:2011-12-05 04:49:24
【问题描述】:

这是this thread 的后续行动--不幸的是,我当时没有取得任何进展,所以我想我会重新开始。我一直在调试日志中得到这个(QtCreator 2.3.1、Qt 4.7.3、gdb 7.2):

0'.\n" 295^error,msg="A syntax error in expression, near0' 附近的表达式语法错误。" &"此 GDB 副本不支持 Python 脚本。\n" " 296^error,msg="此 GDB 副本不支持 Python 脚本。" &"此 GDB 副本不支持 Python 脚本。\n" " 297^error,msg="此 GDB 副本不支持 Python 脚本。" &"此 GDB 副本不支持 Python 脚本。\n" 298^error,msg="此 GDB 副本不支持 Python 脚本。" &"未定义的命令:\"bbsetup\"。试试\"help\"。\n" 299^error,msg="未定义命令:\"bbsetup\"。尝试\"help\"。" d在 处找不到调试帮助程序库。 &"source /home/matt/QtSDK-4.7.3/pythongdb/gdb\n" &"/home/matt/QtSDK-4.7.3/pythongdb/gdb:1: 源命令文件错误:\n" &"未定义的命令:\"\"。试试\"help\"。\n" 300^error,msg="/home/matt/QtSDK-4.7.3/pythongdb/gdb:1: 源命令文件中的错误:\n未定义命令:\"\"。尝试\"help\"。" &"未定义的命令:\"bbsetup\"。试试\"help\"。\n" 301^error,msg="未定义命令:\"bbsetup\"。尝试\"help\"。" d在 处找不到调试帮助程序库。 302^完成

具体的问题是,没有调试助手,在调试过程中我无法看到QStrings和许多其他数据结构的内容,这使得它更加耗时。上面的错误信息是有症状的,问题是gdb找不到调试助手时出现的。

无论如何,查看上述线程中答案中引用的讨论,我在我的系统上寻找不同版本的 gdb,但它们中的每一个都产生了相同的错误(当然,路径已适当更改),包括版本7.3.1 当我下载它时。我也找到了 libDebuggingHelper.so,但将它放在不同的地方也没有帮助。最后查看 ./configure --help for gdb,我没有看到在构建中启用/禁用 python 的任何选项。有人知道我怎样才能让它工作吗?

【问题讨论】:

    标签: debugging qt gdb qt-creator


    【解决方案1】:

    This site 声称您需要使用配置 GDB

    ./configure --with-python
    

    【讨论】:

    • 我试过了,在$ sudo make install 之后得到了checking whether to use python... yes checking for python... (cached) /usr/bin/python checking for python2.6... no configure: error: python is missing or unusable。但是$ cd /usr/bin$ ./python 说我使用的是 2.6.5 版本。知道有什么交易吗?
    • 你需要安装python-2.6-dev包。 python 本身来自python-minimal 之类的,不足以开发依赖于libpython 的东西(例如GDB)。
    • @Employed Russian Woo hoo!那行得通。问题解决了。注意 'sudo apt-get install python-dev' 是必要的命令。
    【解决方案2】:

    从错误消息中可以清楚地看出,您构建的 GDB 没有编译 python 支持。

    gdb/config.log 中查找类似checking whether to use python 的消息,看看为什么 GDB 决定不在您的系统上使用 Python。

    也许您需要安装 Python 开发包?

    将 GDB 配置为使用 Python 后,检查 Python 支持是否正确编译的简单方法是:

    (gdb) python print "hello"
    

    如果打印的不是hello,那么你仍然不是你想去的地方。

    【讨论】:

      【解决方案3】:

      我解决了这个问题

      sudo apt-get install gdb-multiarch
      

      感谢@Employed-Russian 允许我检查 GDB 是否确实支持 python。

      我确实必须使用语法

      (gdb) python print("Hello")
      

      在 GDB 中从 python 获得正确的响应。

      【讨论】:

        猜你喜欢
        • 2013-01-23
        • 2022-06-27
        • 1970-01-01
        • 2010-10-08
        • 2021-03-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多