forked from qt-creator/qt-creator
Debugger: improve dump time for various msvc std containers
... by caching the info whether we have a debug build. This avoids expanding members of the container to check for a potential offset of the actual data. Change-Id: I4d7ac83003c303185ae51d57f0f0571b627edf22 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -167,6 +167,7 @@ class DumperBase():
|
||||
self.isGdb = False
|
||||
self.isLldb = False
|
||||
self.isCli = False
|
||||
self.isDebugBuild = None
|
||||
|
||||
# Later set, or not set:
|
||||
self.stringCutOff = 10000
|
||||
|
@@ -204,11 +204,17 @@ def qdump__std__list(d, value):
|
||||
|
||||
|
||||
def qdump__std__list__QNX(d, value):
|
||||
if d.isDebugBuild is None:
|
||||
try:
|
||||
_ = value["_Mypair"]["_Myval2"]["_Myproxy"]
|
||||
(proxy, head, size) = value.split("ppp")
|
||||
d.isDebugBuild = True
|
||||
except Exception:
|
||||
d.isDebugBuild = False
|
||||
if d.isDebugBuild:
|
||||
(proxy, head, size) = value.split("ppp")
|
||||
else:
|
||||
(head, size) = value.split("pp")
|
||||
|
||||
d.putItemCount(size, 1000)
|
||||
|
||||
if d.isExpanded():
|
||||
@@ -271,10 +277,15 @@ def qdump__std__map(d, value):
|
||||
|
||||
|
||||
def qdump_std__map__helper(d, value):
|
||||
if d.isDebugBuild is None:
|
||||
try:
|
||||
_ = value["_Mypair"]["_Myval2"]["_Myval2"]["_Myproxy"]
|
||||
(proxy, head, size) = value.split("ppp")
|
||||
d.isDebugBuild = True
|
||||
except Exception:
|
||||
d.isDebugBuild = False
|
||||
if d.isDebugBuild:
|
||||
(proxy, head, size) = value.split("ppp")
|
||||
else:
|
||||
(head, size) = value.split("pp")
|
||||
d.check(0 <= size and size <= 100 * 1000 * 1000)
|
||||
d.putItemCount(size)
|
||||
@@ -450,10 +461,15 @@ def qdump__std__set(d, value):
|
||||
|
||||
|
||||
def qdump__std__set__QNX(d, value):
|
||||
if d.isDebugBuild is None:
|
||||
try:
|
||||
_ = value["_Mypair"]["_Myval2"]["_Myval2"]["_Myproxy"]
|
||||
(proxy, head, size) = value.split("ppp")
|
||||
d.isDebugBuild = True
|
||||
except Exception:
|
||||
d.isDebugBuild = False
|
||||
if d.isDebugBuild:
|
||||
(proxy, head, size) = value.split("ppp")
|
||||
else:
|
||||
(head, size) = value.split("pp")
|
||||
d.check(0 <= size and size <= 100 * 1000 * 1000)
|
||||
d.putItemCount(size)
|
||||
@@ -576,24 +592,28 @@ def qdumpHelper__std__string__QNX(d, value, charType, format):
|
||||
|
||||
|
||||
def qdumpHelper__std__string__MSVC(d, value, charType, format):
|
||||
if d.isDebugBuild is None:
|
||||
try:
|
||||
_ = value["_Mypair"]["_Myval2"]["_Myproxy"]
|
||||
(proxy, buffer, size, alloc) = value.split("p16spp")
|
||||
d.isDebugBuild = True
|
||||
except Exception:
|
||||
proxy = None
|
||||
d.isDebugBuild = False
|
||||
if d.isDebugBuild:
|
||||
(_, buffer, size, alloc) = value.split("p16spp")
|
||||
else:
|
||||
(buffer, size, alloc) = value.split("16spp")
|
||||
d.check(0 <= size and size <= alloc and alloc <= 100 * 1000 * 1000)
|
||||
_BUF_SIZE = int(16 / charType.size())
|
||||
if _BUF_SIZE <= alloc:
|
||||
if proxy is None:
|
||||
data = value.extractPointer()
|
||||
else:
|
||||
if d.isDebugBuild:
|
||||
(proxy, data) = value.split("pp")
|
||||
else:
|
||||
if proxy is None:
|
||||
data = value.address()
|
||||
data = value.extractPointer()
|
||||
else:
|
||||
if d.isDebugBuild:
|
||||
data = value.address() + d.ptrSize()
|
||||
else:
|
||||
data = value.address()
|
||||
d.putCharArrayHelper(data, size, charType, format)
|
||||
|
||||
|
||||
@@ -656,10 +676,15 @@ def qdump__std__unordered_map(d, value):
|
||||
|
||||
if d.isMsvcTarget():
|
||||
_list = value["_List"]
|
||||
if d.isDebugBuild is None:
|
||||
try:
|
||||
_ = _list["_Mypair"]["_Myval2"]["_Myproxy"]
|
||||
(_, start, size) = _list.split("ppp")
|
||||
d.isDebugBuild = True
|
||||
except Exception:
|
||||
d.isDebugBuild = False
|
||||
if d.isDebugBuild:
|
||||
(_, start, size) = _list.split("ppp")
|
||||
else:
|
||||
(start, size) = _list.split("pp")
|
||||
else:
|
||||
try:
|
||||
@@ -894,18 +919,28 @@ def qdumpHelper__std__vector__libcxx(d, value):
|
||||
def qdumpHelper__std__vector__msvc(d, value):
|
||||
inner_type = value.type[0]
|
||||
if inner_type.name == "bool":
|
||||
if d.isDebugBuild is None:
|
||||
try:
|
||||
_ = value["_Myproxy"]
|
||||
proxy1, proxy2, start, finish, alloc, size = value.split("pppppi")
|
||||
d.isDebugBuild = True
|
||||
except RuntimeError:
|
||||
d.isDebugBuild = False
|
||||
if d.isDebugBuild:
|
||||
proxy1, proxy2, start, finish, alloc, size = value.split("pppppi")
|
||||
else:
|
||||
start, finish, alloc, size = value.split("pppi")
|
||||
d.check(0 <= size and size <= 1000 * 1000 * 1000)
|
||||
qdumpHelper__std__vector__bool(d, start, size, inner_type)
|
||||
else:
|
||||
if d.isDebugBuild is None:
|
||||
try:
|
||||
_ = value["_Mypair"]["_Myval2"]["_Myproxy"]
|
||||
proxy, start, finish, alloc = value.split("pppp")
|
||||
d.isDebugBuild = True
|
||||
except RuntimeError:
|
||||
d.isDebugBuild = False
|
||||
if d.isDebugBuild:
|
||||
proxy, start, finish, alloc = value.split("pppp")
|
||||
else:
|
||||
start, finish, alloc = value.split("ppp")
|
||||
size = (finish - start) // inner_type.size()
|
||||
d.check(0 <= size and size <= 1000 * 1000 * 1000)
|
||||
|
Reference in New Issue
Block a user