aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2008-12-17 15:46:27 +0100
committerhjk <qtc-committer@nokia.com>2008-12-17 15:46:27 +0100
commit04c4a0ec720059414ddf1c702e1fb28e4876d2f9 (patch)
treef458a33d5ccb8d38b39efde633ea0b7722e1f2a0 /bin
parentfff7acad55f0d2009afe8941ef2c7cd37481da6f (diff)
make the std::map dumper work with keys that already have a const
qualification like 'const char *'
Diffstat (limited to 'bin')
-rw-r--r--bin/gdbmacros/gdbmacros.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/gdbmacros/gdbmacros.cpp b/bin/gdbmacros/gdbmacros.cpp
index ca19e58702..a3b3de6a4d 100644
--- a/bin/gdbmacros/gdbmacros.cpp
+++ b/bin/gdbmacros/gdbmacros.cpp
@@ -2155,6 +2155,14 @@ static void qDumpStdMap(QDumper &d)
P(d, "valuedisabled", "true");
P(d, "valueoffset", d.extraInt[2]);
+ // HACK: we need a properly const qualified version of the
+ // std::pair used. We extract it from the allocator parameter
+ // as it is there, and, equally importantly, in an order that
+ // gdb accepts when fed with it.
+ char *pairType = (char *)(d.templateParameters[3]) + 16;
+ pairType[strlen(pairType) - 2] = 0;
+ P(d, "pairtype", pairType);
+
if (d.dumpChildren) {
bool simpleKey = isSimpleType(keyType);
bool simpleValue = isShortKey(valueType);
@@ -2177,7 +2185,7 @@ static void qDumpStdMap(QDumper &d)
d.beginHash();
P(d, "name", "[" << i << "]");
P(d, "addr", it.operator->());
- P(d, "type", "std::pair<const " << keyType << "," << valueType << " >");
+ P(d, "type", pairType);
d.endHash();
}
}