diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 836b1860cb2..059bf7b23e7 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -453,6 +453,10 @@ class DumperBase(): return self.listTemplateParametersManually(typename) def listTemplateParametersManually(self, typename): + # Undo id mangling for template typedefs. Relevant for QPair. + if typename.endswith('}'): + typename = typename[typename.find('{') + 1 : -1] + targs = [] if not typename.endswith('>'): return targs @@ -3629,7 +3633,7 @@ class DumperBase(): def templateArgument(self, position): #DumperBase.warn('TDATA: %s' % self.tdata) #DumperBase.warn('ID: %s' % self.typeId) - if self.tdata is None: + if self.tdata is None or self.tdata.templateArguments is None: # Native lookups didn't help. Happens for 'wrong' placement of 'const' # etc. with LLDB. But not all is lost: ta = self.dumper.listTemplateParameters(self.typeId) diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index efd4e66a8ed..c0f56ba941f 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -3338,6 +3338,31 @@ void tst_Dumpers::dumper_data() + Check("sf0", "(-1.0, -1.0)", "@QSizeF") + Check("sf", "(100.5, 200.5)", "@QSizeF"); + QTest::newRow("QPair") + << Data("#include \n" + "#include \n", + "QString s = \"sss\";\n" + "QString t = \"ttt\";\n" + "QPair pii(1, 2);\n" + "QPair pis(1, t);\n" + "QPair psi(s, 2);\n" + "QPair pss(s, t);\n", + "&pii, &pis, &psi, &pss") + + + CoreProfile() + + + Check("pii", "(1, 2)", "@QPair") + + Check("pii.first", "1", "int") + + Check("pii.second", "2", "int") + + Check("pis", "(1, ...)", "@QPair") + + Check("pis.first", "1", "int") + + Check("pis.second", "\"ttt\"", "@QString") + + Check("psi", "(..., 2)", "@QPair") + + Check("psi.first", "\"sss\"", "@QString") + + Check("psi.second", "2", "int") + + Check("pss", "(..., ...)", "@QPair") + + Check("pss.first", "\"sss\"", "@QString") + + Check("pss.second", "\"ttt\"", "@QString"); QTest::newRow("QRegion") << Data("#include \n"