From 01f26bd5b748a7b2257debd0f6d35fb15fcaa284 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Fri, 21 Jun 2019 09:44:53 +0200 Subject: [PATCH] Fix std::vector printer with custom allocator This fixes the std::vector pretty printer, which previously just showed "" for variable 'v' for the following sample code (with system GDB pretty printer disabled so that the custom pretty printers are used): #include template class myallocator : public std::allocator { }; int main() { std::vector> v; v.push_back(true); return 0; // break here and check value of 'v' } Change-Id: Ia9883aa0b06a396cb3546ac2594a82c1b2062b80 Reviewed-by: hjk --- share/qtcreator/debugger/stdtypes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/debugger/stdtypes.py b/share/qtcreator/debugger/stdtypes.py index a14029fdc34..8e80aafcdbf 100644 --- a/share/qtcreator/debugger/stdtypes.py +++ b/share/qtcreator/debugger/stdtypes.py @@ -973,9 +973,9 @@ def qdumpHelper__std__vector(d, value, isLibCpp): (start, soffset, pad, finish, foffset, pad, alloc) = value.split("pI@pI@p") else: start = value["_M_start"]["_M_p"].pointer() - soffset = value["_M_start"]["_M_offset"] + soffset = value["_M_start"]["_M_offset"].integer() finish = value["_M_finish"]["_M_p"].pointer() - foffset = value["_M_finish"]["_M_offset"] + foffset = value["_M_finish"]["_M_offset"].integer() alloc = value["_M_end_of_storage"].pointer() size = (finish - start) * 8 + foffset - soffset # 8 is CHAR_BIT. else: