forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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())
|
||||
|
||||
|
Reference in New Issue
Block a user