• 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的问题

  • 相关阅读:
    springdata jpa
    springboot添加事务
    hibernate缓存
    idea下的hibernate反向生成插件
    hibernate级联查询映射的两种方式
    Spring Hibernate JPA 联表查询 复杂查询
    thymeleaf模板引擎
    java替换富文本标签等
    mac最新系统安装beego出现kiil 9
    xshell配置
  • 原文地址:https://www.cnblogs.com/guobbs/p/11833647.html
Copyright © 2020-2023  润新知