aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/debugger
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2019-02-25 16:16:02 +0100
committerhjk <hjk@qt.io>2019-02-26 07:36:13 +0000
commit41da97fb2cfb88baa7872d370e1e9665c85432d2 (patch)
tree4808f2a8bd8ee03d58a3745f8e7dc4308a4e2345 /share/qtcreator/debugger
parenta53032d6a597779bc98a5c4d0bff34338dd6395e (diff)
Debugger: Do not make std::string layout assumptions
... when non-std allocator is used. Task-number: QTCREATORBUG-22040 Change-Id: I67785095f50058851c358a45ef19e0c41743fe4f Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'share/qtcreator/debugger')
-rw-r--r--share/qtcreator/debugger/stdtypes.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/share/qtcreator/debugger/stdtypes.py b/share/qtcreator/debugger/stdtypes.py
index 154e0ad67e..8810e09912 100644
--- a/share/qtcreator/debugger/stdtypes.py
+++ b/share/qtcreator/debugger/stdtypes.py
@@ -1024,7 +1024,20 @@ def qdump__std__basic_string(d, value):
def qdump__std____cxx11__basic_string(d, value):
innerType = value.type[0]
- (data, size) = value.split("pI")
+ try:
+ allocator = value.type[2].name
+ except:
+ allocator = ''
+ if allocator == 'std::allocator<%s>' % innerType.name:
+ (data, size) = value.split("pI")
+ else:
+ try:
+ data = value["_M_dataplus"]["_M_p"]
+ size = int(value["_M_string_length"])
+ except:
+ d.putEmptyValue()
+ d.putPlainChildren(value)
+ return
d.check(0 <= size) #and size <= alloc and alloc <= 100*1000*1000)
d.putCharArrayHelper(data, size, innerType, d.currentItemFormat())