zoukankan      html  css  js  c++  java
  • QtCreator调试遇到 #line 的问题

    今天调试一段代码的时候,遇到一个问题

    如下图所示,代码中有 #line的关键字,导致了QtCreator无法调试,主要是不能正常的单步执行,我的开发环境是(vc2015)

    于是给Qt官方提交bug,https://bugreports.qt.io/browse/QTCREATORBUG-23082

    经过将近一个月的等待,终于等来了官方的回复。

    其实这个问题原因不是 #line的问题,而是 atoi.rl 的问题,这个文件是中间代码,依靠它生成的C++代码会参与真正的项目编译,生成的代码里面在有需要的位置会使用#line来指示调试器重定位到atoi.rl,调试的时候还需要用到此文件。

    在QtCreator环境中启动调试,默认只把 %{buildDir} 目录环境给了 cdb ,cdb在调试的时候,跟据上面的#Line指示的文件,在 %{buildDir} 目录中是找不到这个文件的,也导致单步执行定位失败,只能在栈上看到数据,却定位不到源代码的line位置。

    解决方法就是 附加一个 cp 命令,自动把 atoi.rl 文件copy到 %{buildDir}中去。

    见官方原始回复:

    It seems cdb is able to find the correct source location, because lsa with the address returned by

    x demo_ragel!a_to_longlong but when listing stack frames via k it just returns a constructed path with %{buildDir} and atoi.rl

    Not even setting the cdb source path to the demo_ragel source directory seems to improve the situation there, the only thing that helped for me  is to add an additional deploy step with a cp command and the {{%{sourceDir}atoi.rl %{buildDir} }} as arguments.

    So as this seems to be a CDB issue I declare this as out of scope, try reporting this issue to Microsoft.

    当然了,官方工作人员认为这是CDB的问题,但我不认为这是CDB的问题

  • 相关阅读:
    黑马程序员__OC三大特性
    黑马程序员___OC类和对象
    黑马程序员___预处理指令
    黑马程序员___数据类型总结
    黑马程序员__指针
    黑马程序员__C语言__函数__static和extern
    黑马程序员__C语言__流程控制__选择结构
    黑马程序员__C语言__循环结构
    入园随笔
    Fiddler中抓取不到Jmeter模拟的请求包。
  • 原文地址:https://www.cnblogs.com/guobbs/p/11833647.html
Copyright © 2011-2022 走看看