From bae72fcc512f0a32c929510725dff1870f56305c Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 24 Nov 2016 09:27:36 +0100 Subject: [PATCH] Debugger: Fix MSVC python dumper for std::vector Change-Id: I843f6195a9d51066eae57b7d383a0450fe4c56a1 Reviewed-by: hjk <hjk@qt.io> --- share/qtcreator/debugger/stdtypes.py | 29 ++++++++-------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/share/qtcreator/debugger/stdtypes.py b/share/qtcreator/debugger/stdtypes.py index f205ed6b6e9..c4d050a6173 100644 --- a/share/qtcreator/debugger/stdtypes.py +++ b/share/qtcreator/debugger/stdtypes.py @@ -915,39 +915,26 @@ def qdumpHelper__std__vector__QNX(d, value): innerType = value.type[0] isBool = innerType.name == 'bool' if isBool: - try: - impl = value['_Myvec']['_Mypair']['_Myval2'] - except: - impl = value['_Myvec'] - start = impl['_Myfirst'].pointer() - last = impl['_Mylast'].pointer() - end = impl['_Myend'].pointer() - size = value['_Mysize'].integer() - storagesize = start.dereference().type.size() * 8 + (proxy1, proxy2, start, last, end, size) = value.split("pppppi") else: - try: - impl = value['_Mypair']['_Myval2'] - except: - impl = value - start = impl['_Myfirst'].pointer() - last = impl['_Mylast'].pointer() - end = impl['_Myend'].pointer() + (proxy, start, last, end) = value.split("pppp") size = (last - start) // innerType.size() d.check(0 <= size and size <= 1000 * 1000 * 1000) d.check(last <= end) - d.checkPointer(start) - d.checkPointer(last) - d.checkPointer(end) + if size > 0: + d.checkPointer(start) + d.checkPointer(last) + d.checkPointer(end) d.putItemCount(size) if d.isExpanded(): if isBool: with Children(d, size, maxNumChild=10000, childType=innerType): for i in d.childRange(): - q = start + int(i / storagesize) + q = start + int(i / 8) with SubItem(d, i): - d.putValue((q.dereference().pointer() >> (i % storagesize)) & 1) + d.putValue((d.extractPointer(q) >> (i % 8)) & 1) d.putType("bool") d.putNumChild(0) else: -- GitLab