diff options
author | David Schulz <david.schulz@qt.io> | 2023-02-27 09:15:17 +0100 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2023-02-27 12:26:37 +0000 |
commit | a4fb9e20cb0395568264c89a8e75d35e5f007fae (patch) | |
tree | 42e2a8a08816d2d4dc45dd6a8dd1f5ee63ecd1de | |
parent | efe5735452cdf8c847f2b00105f4c962da3828a9 (diff) | |
download | qt-creator-a4fb9e20cb0395568264c89a8e75d35e5f007fae.tar.gz |
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>
-rw-r--r-- | share/qtcreator/debugger/dumper.py | 1 | ||||
-rw-r--r-- | share/qtcreator/debugger/stdtypes.py | 93 |
2 files changed, 65 insertions, 29 deletions
diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index f72ea04b38..42b2a8c829 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -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 diff --git a/share/qtcreator/debugger/stdtypes.py b/share/qtcreator/debugger/stdtypes.py index e376e29ef4..622bec4e5c 100644 --- a/share/qtcreator/debugger/stdtypes.py +++ b/share/qtcreator/debugger/stdtypes.py @@ -204,11 +204,17 @@ def qdump__std__list(d, value): def qdump__std__list__QNX(d, value): - try: - _ = value["_Mypair"]["_Myval2"]["_Myproxy"] + if d.isDebugBuild is None: + try: + _ = value["_Mypair"]["_Myval2"]["_Myproxy"] + d.isDebugBuild = True + except Exception: + d.isDebugBuild = False + if d.isDebugBuild: (proxy, head, size) = value.split("ppp") - except Exception: + 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): - try: - _ = value["_Mypair"]["_Myval2"]["_Myval2"]["_Myproxy"] + if d.isDebugBuild is None: + try: + _ = value["_Mypair"]["_Myval2"]["_Myval2"]["_Myproxy"] + d.isDebugBuild = True + except Exception: + d.isDebugBuild = False + if d.isDebugBuild: (proxy, head, size) = value.split("ppp") - except Exception: + 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): - try: - _ = value["_Mypair"]["_Myval2"]["_Myval2"]["_Myproxy"] + if d.isDebugBuild is None: + try: + _ = value["_Mypair"]["_Myval2"]["_Myval2"]["_Myproxy"] + d.isDebugBuild = True + except Exception: + d.isDebugBuild = False + if d.isDebugBuild: (proxy, head, size) = value.split("ppp") - except Exception: + 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): - try: - _ = value["_Mypair"]["_Myval2"]["_Myproxy"] - (proxy, buffer, size, alloc) = value.split("p16spp") - except Exception: - proxy = None + if d.isDebugBuild is None: + try: + _ = value["_Mypair"]["_Myval2"]["_Myproxy"] + d.isDebugBuild = True + except Exception: + 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() else: + 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"] - try: - _ = _list["_Mypair"]["_Myval2"]["_Myproxy"] + if d.isDebugBuild is None: + try: + _ = _list["_Mypair"]["_Myval2"]["_Myproxy"] + d.isDebugBuild = True + except Exception: + d.isDebugBuild = False + if d.isDebugBuild: (_, start, size) = _list.split("ppp") - except Exception: + 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": - try: - _ = value["_Myproxy"] + if d.isDebugBuild is None: + try: + _ = value["_Myproxy"] + d.isDebugBuild = True + except RuntimeError: + d.isDebugBuild = False + if d.isDebugBuild: proxy1, proxy2, start, finish, alloc, size = value.split("pppppi") - except RuntimeError: + 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: - try: - _ = value["_Mypair"]["_Myval2"]["_Myproxy"] + if d.isDebugBuild is None: + try: + _ = value["_Mypair"]["_Myval2"]["_Myproxy"] + d.isDebugBuild = True + except RuntimeError: + d.isDebugBuild = False + if d.isDebugBuild: proxy, start, finish, alloc = value.split("pppp") - except RuntimeError: + else: start, finish, alloc = value.split("ppp") size = (finish - start) // inner_type.size() d.check(0 <= size and size <= 1000 * 1000 * 1000) |