diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index 25faf326a31..2eb3055e8a0 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -1062,7 +1062,11 @@ def qdump__QRegExp(d, value): d.putNumChild(1) if d.isExpanded(): with Children(d): - d.call('void', value, 'capturedTexts') # Warm up internal cache. + try: + d.call('void', value, 'capturedTexts') # Warm up internal cache. + except: + # Might fail (LLDB, Core files, ...), still cache might be warm. + pass (patternSyntax, caseSensitive, minimal, pad, t, captures) \ = d.split('{int}{int}B@{QString}{QStringList}', privAddress + 2 * d.ptrSize()) d.putSubItem('syntax', patternSyntax.cast(d.qtNamespace() + 'QRegExp::PatternSyntax')) diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index bcac63df91e..f2b540239de 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -2748,12 +2748,14 @@ void tst_Dumpers::dumper_data() QTest::newRow("QRegExp") - << Data("#include \n", + << Data("#include \n" + "#include \n", "QRegExp re(QString(\"a(.*)b(.*)c\"));\n" "QString str1 = \"a1121b344c\";\n" "QString str2 = \"Xa1121b344c\";\n" "int pos1 = re.indexIn(str1); unused(&pos1);\n" - "int pos2 = re.indexIn(str2); unused(&pos2);\n") + "int pos2 = re.indexIn(str2); unused(&pos2);\n" + "QStringList caps = re.capturedTexts(); unused(&caps);\n") + CoreProfile() + UseDebugImage() + Check("re", "\"a(.*)b(.*)c\"", "@QRegExp") @@ -2762,7 +2764,8 @@ void tst_Dumpers::dumper_data() + Check("re.captures.2", "[2]", "\"344\"", "@QString") + Check("str2", "\"Xa1121b344c\"", "@QString") + Check("pos1", "0", "int") - + Check("pos2", "1", "int"); + + Check("pos2", "1", "int") + + Check("caps", "<3 items>", "@QStringList"); QTest::newRow("QRect")