Commit 6444211a authored by Harald Sitter's avatar Harald Sitter 🏳️‍🌈
Browse files

prepare backtraceparser for use from qml

QSet<QString> is now QStringList so we can simply pass it to qml without
any conversion going on. plus we kind of want to use it like a list
anyway.
parent 10d6bc79
......@@ -276,7 +276,7 @@ void BacktraceWidget::loadData()
QLatin1String("#missingDebugPackages")));
ui.m_installDebugButton->setVisible(true);
// Retrieve the libraries with missing debug info
QStringList missingLibraries = btParser->librariesWithMissingDebugSymbols().values();
const QStringList missingLibraries = btParser->librariesWithMissingDebugSymbols();
m_debugPackageInstaller->setMissingLibraries(missingLibraries);
} else {
// No automated method to install the missing debug info
......@@ -402,7 +402,7 @@ void BacktraceWidget::extraDetailsLinkActivated(QString link)
} else if (link == QLatin1String("#missingDebugPackages")) {
BacktraceParser *btParser = m_btGenerator->parser();
QStringList missingDbgForFiles = btParser->librariesWithMissingDebugSymbols().values();
QStringList missingDbgForFiles = btParser->librariesWithMissingDebugSymbols();
missingDbgForFiles.insert(0, DrKonqi::crashedApplication()->executable().absoluteFilePath());
// HTML message
......
......@@ -106,7 +106,7 @@ QStringList BacktraceParser::firstValidFunctions() const
return d ? d->m_firstUsefulFunctions : QStringList();
}
QSet<QString> BacktraceParser::librariesWithMissingDebugSymbols() const
QStringList BacktraceParser::librariesWithMissingDebugSymbols() const
{
Q_D(const BacktraceParser);
......@@ -116,7 +116,7 @@ QSet<QString> BacktraceParser::librariesWithMissingDebugSymbols() const
}
// if there is no d, the debugger has not run yet, so we have no libraries.
return d ? d->m_librariesWithMissingDebugSymbols : QSet<QString>();
return d ? d->m_librariesWithMissingDebugSymbols : QStringList();
}
bool BacktraceParser::hasCompositorCrashed() const
......@@ -310,7 +310,7 @@ void BacktraceParser::calculateRatingData()
}
if (line.rating() == BacktraceLine::MissingFunction || line.rating() == BacktraceLine::MissingSourceFile) {
d->m_librariesWithMissingDebugSymbols.insert(line.libraryName().trimmed());
d->m_librariesWithMissingDebugSymbols.append(line.libraryName().trimmed());
}
uint multiplier = ++counter; // give weight to the first lines
......
......@@ -57,10 +57,10 @@ public:
/*! Returns a short list of the first good functions that appear in the backtrace
* (in the crashing thread). This is used for quering for duplicate reports.
*/
virtual QStringList firstValidFunctions() const;
Q_INVOKABLE virtual QStringList firstValidFunctions() const;
/*! Returns a list of libraries/executables that are missing debug symbols. */
virtual QSet<QString> librariesWithMissingDebugSymbols() const;
Q_INVOKABLE virtual QStringList librariesWithMissingDebugSymbols() const;
/*! Check if the crash is because of the client aborting after a compositor crash.
* https://bugs.kde.org/show_bug.cgi?id=431561
......
......@@ -25,7 +25,7 @@ public:
QList<BacktraceLine> m_linesToRate;
QStringList m_firstUsefulFunctions;
QString m_simplifiedBacktrace;
QSet<QString> m_librariesWithMissingDebugSymbols;
QStringList m_librariesWithMissingDebugSymbols;
BacktraceParser::Usefulness m_usefulness;
bool m_compositorCrashed = false;
};
......
......@@ -51,7 +51,7 @@ int main(int argc, char **argv)
std::cout << "Usefulness: " << qPrintable(metaUsefulness.valueToKey(btparser->backtraceUsefulness())) << std::endl;
std::cout << "First valid functions: " << qPrintable(btparser->firstValidFunctions().join(QLatin1Char(' '))) << std::endl;
std::cout << "Simplified backtrace:\n" << qPrintable(btparser->simplifiedBacktrace()) << std::endl;
const QStringList l = static_cast<QStringList>(btparser->librariesWithMissingDebugSymbols().values());
const QStringList l = static_cast<QStringList>(btparser->librariesWithMissingDebugSymbols());
std::cout << "Missing dbgsym libs: " << qPrintable(l.join(QLatin1Char(' '))) << std::endl;
return 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment