From ff94d06ae30fbf309880cf19a811843a2d923b0f Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 22 Jun 2011 17:49:33 +0200 Subject: [PATCH] debugger: fix gcc 4.4's std::map display Was mentioned at http://www.qtcentre.org/threads/41700-How-to-watch-STL-containers-iterators-during-debugging. gcc 4.4 does not encode the allocator type properly so it can't be used to extract the 'pair type' in the dumper. Change-Id: I2cb09ce59865a87dc954fce433aef4826111a95a Reviewed-on: http://codereview.qt.nokia.com/632 Reviewed-by: Qt Sanity Bot Reviewed-by: hjk --- share/qtcreator/gdbmacros/gdbmacros.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/gdbmacros/gdbmacros.py b/share/qtcreator/gdbmacros/gdbmacros.py index 74e65084edb..13ce73df260 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.py +++ b/share/qtcreator/gdbmacros/gdbmacros.py @@ -1799,7 +1799,11 @@ def qdump__std__map(d, item): if d.isExpanded(item): keyType = templateArgument(item.value.type, 0) valueType = templateArgument(item.value.type, 1) - pairType = templateArgument(templateArgument(item.value.type, 3), 0) + # Does not work on gcc 4.4, the allocator type (fourth template + # argument) seems not to be available. + # pairType = templateArgument(templateArgument(item.value.type, 3), 0) + # So use this as workaround: + pairType = templateArgument(impl.type, 1) isSimpleKey = isSimpleType(keyType) isSimpleValue = isSimpleType(valueType) innerType = pairType