From 4e281167ee13ff3ac0b32d6bdba09f2fda0f5b48 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 5 Oct 2010 14:25:04 +0200 Subject: [PATCH] Debugger[CDB]: Adapt SharedLib-Dumpers to new std::vector. Reviewed-by: hjk --- share/qtcreator/gdbmacros/gdbmacros.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/qtcreator/gdbmacros/gdbmacros.cpp b/share/qtcreator/gdbmacros/gdbmacros.cpp index 0250be1741c..33787c70110 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.cpp +++ b/share/qtcreator/gdbmacros/gdbmacros.cpp @@ -3457,7 +3457,11 @@ static void qDumpStdVector(QDumper &d) #ifdef Q_CC_MSVC // Pointers are at end of the structure const char * vcp = static_cast(d.data); +# if _MSC_VER >= 1600 // VS2010 onwards: Beginning of structure + base class containing pointer + const VectorImpl *v = reinterpret_cast(vcp + sizeof(void*)); +# else // pre VS2010: End of structure const VectorImpl *v = reinterpret_cast(vcp + sizeof(std::vector) - sizeof(VectorImpl)); +# endif // _MSC_VER #else const VectorImpl *v = static_cast(d.data); #endif