(ubuntu)QTcreator debugger std::string类型数据调试显示<无法访问>

在Ubuntu环境下使用QTcreator遇到调试std::string时显示‘无法访问’的问题。通过修改qtcreator目录下(debugger/stdtypes.py)文件中的两处代码,将原有内容替换为指定的修复代码,可以解决此问题。
摘要由CSDN通过智能技术生成

@[TOC]((ubuntu)QTcreator debugger std::string类型数据调试显示<无法访问>)

原链接: QtCreator debugger does not display values of std::string.

1.找到qtcreator目录下/qtcreator/debugger/stdtypes.py文件,例如路径:/Qt5.9.0/Tools/QtCreator/share/qtcreator/debugger,右击在终端中打开。

2.输入

sudo vim stdtypes.py

3.找到

def qdumpHelper_std__string(d, value, charType, format):

4.修改
(1)将

(size, alloc, refcount) = d.split("ppp", data - 3 * d.ptrSize())

改为:

(size, alloc, refcount) = d.split("ppp", value.address() + d.ptrSize())

(2)将

d.check(0 <= size and size <= alloc and alloc <= 100*1000*1000)
<
  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值