From 5a0734a9bf06a2d0bded7726b0c0f51d5112a8e0 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 9 Jul 2013 12:44:26 +0200 Subject: [PATCH] Debugger: Fix std::string display with old LLDB (179.5) Change-Id: I9a9abd3044a9ec90c67de3060d5895ae0b6b8652 Reviewed-by: hjk --- share/qtcreator/dumper/qttypes.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/share/qtcreator/dumper/qttypes.py b/share/qtcreator/dumper/qttypes.py index b8599c76d2a..ad5fb6dc33d 100644 --- a/share/qtcreator/dumper/qttypes.py +++ b/share/qtcreator/dumper/qttypes.py @@ -2378,9 +2378,10 @@ def qform__std__string(): return "Inline,In Separate Window" def qdump__std__string(d, value): + qdump__std__stringHelper1(d, value, 1) + +def qdump__std__stringHelper1(d, value, charSize): data = value["_M_dataplus"]["_M_p"] - baseType = value.type.strip_typedefs() - charSize = d.templateArgument(baseType, 0).sizeof # We can't lookup the std::string::_Rep type without crashing LLDB, # so hard-code assumption on member position # struct { size_type _M_length, size_type _M_capacity, int _M_refcount; } @@ -2588,13 +2589,14 @@ def qdump__string(d, value): qdump__std__string(d, value) def qdump__std__wstring(d, value): - qdump__std__string(d, value) + charSize = d.lookupType('wchar_t').sizeof + qdump__std__stringHelper1(d, value, charSize) def qdump__std__basic_string(d, value): qdump__std__string(d, value) def qdump__wstring(d, value): - qdump__std__string(d, value) + qdump__std__wstring(d, value) def qdump____gnu_cxx__hash_set(d, value):