forked from qt-creator/qt-creator
Debugger: Move cdbsymbolpathlisteditor to shared for new CDB engine.
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "cdboptions.h"
|
||||
#include "coreengine.h"
|
||||
#include "cdbsymbolpathlisteditor.h"
|
||||
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QDir>
|
||||
@@ -117,36 +118,14 @@ unsigned CdbOptions::compare(const CdbOptions &rhs) const
|
||||
return rc;
|
||||
}
|
||||
|
||||
static const char symbolServerPrefixC[] = "symsrv*symsrv.dll*";
|
||||
static const char symbolServerPostfixC[] = "*http://msdl.microsoft.com/download/symbols";
|
||||
|
||||
QString CdbOptions::symbolServerPath(const QString &cacheDir)
|
||||
{
|
||||
QString s = QLatin1String(symbolServerPrefixC);
|
||||
s += QDir::toNativeSeparators(cacheDir);
|
||||
s += QLatin1String(symbolServerPostfixC);
|
||||
return s;
|
||||
return CdbSymbolPathListEditor::symbolServerPath(cacheDir);
|
||||
}
|
||||
|
||||
bool CdbOptions::isSymbolServerPath(const QString &path, QString *cacheDir /* = 0 */)
|
||||
int CdbOptions::indexOfSymbolServerPath(const QStringList &symbolPaths, QString *cacheDir)
|
||||
{
|
||||
// Split apart symbol server post/prefixes
|
||||
if (!path.startsWith(QLatin1String(symbolServerPrefixC)) || !path.endsWith(QLatin1String(symbolServerPostfixC)))
|
||||
return false;
|
||||
if (cacheDir) {
|
||||
const unsigned prefixLength = qstrlen(symbolServerPrefixC);
|
||||
*cacheDir = path.mid(prefixLength, path.size() - prefixLength - qstrlen(symbolServerPostfixC));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int CdbOptions::indexOfSymbolServerPath(const QStringList &paths, QString *cacheDir /* = 0 */)
|
||||
{
|
||||
const int count = paths.size();
|
||||
for (int i = 0; i < count; i++)
|
||||
if (CdbOptions::isSymbolServerPath(paths.at(i), cacheDir))
|
||||
return i;
|
||||
return -1;
|
||||
return CdbSymbolPathListEditor::indexOfSymbolServerPath(symbolPaths, cacheDir);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user