From 53c763029b3321271d21f19a374bc1875b4b5f6b Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 25 Aug 2020 22:08:35 +0300 Subject: [PATCH] Dumper: Fix size of refcount member in basic_string It's an int. Still, the position is 3 pointer-sizes back due to padding (the next member after this struct is the char pointer). The pointer-size + bitwise stripping of the LSB probably doesn't work on big-endian archs. Change-Id: I4413d9b32986d1ea0be9abe1be4382ee36a9456c Reviewed-by: hjk --- share/qtcreator/debugger/stdtypes.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/qtcreator/debugger/stdtypes.py b/share/qtcreator/debugger/stdtypes.py index bf2f95fcf2e..ccf85375727 100644 --- a/share/qtcreator/debugger/stdtypes.py +++ b/share/qtcreator/debugger/stdtypes.py @@ -707,8 +707,7 @@ def qdumpHelper_std__string(d, value, charType, format): # 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; } - (size, alloc, refcount) = d.split("ppp", data - 3 * d.ptrSize()) - refcount = refcount & 0xffffffff + (size, alloc, refcount) = d.split("ppi", data - 3 * d.ptrSize()) d.check(refcount >= -1) # Can be -1 according to docs. d.check(0 <= size and size <= alloc and alloc <= 100 * 1000 * 1000) d.putCharArrayHelper(data, size, charType, format)