forked from qt-creator/qt-creator
Debugger: detect cdb in non default install roots
Change-Id: Ic5b484c674d750bdcbc24d607720589ee9f056c3 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -636,6 +636,8 @@ void DebuggerItemManagerPrivate::autoDetectCdbDebuggers()
|
|||||||
QString::fromLocal8Bit(qgetenv("ProgramW6432"))
|
QString::fromLocal8Bit(qgetenv("ProgramW6432"))
|
||||||
};
|
};
|
||||||
|
|
||||||
|
QFileInfoList kitFolders;
|
||||||
|
|
||||||
for (const QString &dirName : programDirs) {
|
for (const QString &dirName : programDirs) {
|
||||||
if (dirName.isEmpty())
|
if (dirName.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
@@ -647,18 +649,8 @@ void DebuggerItemManagerPrivate::autoDetectCdbDebuggers()
|
|||||||
QDir windowKitsFolder = dir;
|
QDir windowKitsFolder = dir;
|
||||||
if (windowKitsFolder.cd(windowsKitsFolderName)) {
|
if (windowKitsFolder.cd(windowsKitsFolderName)) {
|
||||||
// Check in reverse order (latest first)
|
// Check in reverse order (latest first)
|
||||||
const QFileInfoList kitFolders =
|
kitFolders.append(windowKitsFolder.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot,
|
||||||
windowKitsFolder.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot,
|
QDir::Time | QDir::Reversed));
|
||||||
QDir::Time | QDir::Reversed);
|
|
||||||
for (const QFileInfo &kitFolderFi : kitFolders) {
|
|
||||||
const QString path = kitFolderFi.absoluteFilePath();
|
|
||||||
const QFileInfo cdb32(path + "/Debuggers/x86/cdb.exe");
|
|
||||||
if (cdb32.isExecutable())
|
|
||||||
cdbs.append(FileName::fromString(cdb32.absoluteFilePath()));
|
|
||||||
const QFileInfo cdb64(path + "/Debuggers/x64/cdb.exe");
|
|
||||||
if (cdb64.isExecutable())
|
|
||||||
cdbs.append(FileName::fromString(cdb64.absoluteFilePath()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -672,6 +664,29 @@ void DebuggerItemManagerPrivate::autoDetectCdbDebuggers()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
constexpr char RootVal[] = "KitsRoot";
|
||||||
|
constexpr char RootVal81[] = "KitsRoot81";
|
||||||
|
constexpr char RootVal10[] = "KitsRoot10";
|
||||||
|
const QSettings installedRoots(
|
||||||
|
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots",
|
||||||
|
QSettings::NativeFormat);
|
||||||
|
for (auto rootVal : {RootVal, RootVal81, RootVal10}) {
|
||||||
|
QFileInfo root(installedRoots.value(QLatin1String(rootVal)).toString());
|
||||||
|
if (root.exists() && !kitFolders.contains(root))
|
||||||
|
kitFolders.append(root);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const QFileInfo &kitFolderFi : kitFolders) {
|
||||||
|
const QString path = kitFolderFi.absoluteFilePath();
|
||||||
|
const QFileInfo cdb32(path + "/Debuggers/x86/cdb.exe");
|
||||||
|
if (cdb32.isExecutable())
|
||||||
|
cdbs.append(FileName::fromString(cdb32.absoluteFilePath()));
|
||||||
|
const QFileInfo cdb64(path + "/Debuggers/x64/cdb.exe");
|
||||||
|
if (cdb64.isExecutable())
|
||||||
|
cdbs.append(FileName::fromString(cdb64.absoluteFilePath()));
|
||||||
|
}
|
||||||
|
|
||||||
for (const FileName &cdb : Utils::asConst(cdbs)) {
|
for (const FileName &cdb : Utils::asConst(cdbs)) {
|
||||||
if (DebuggerItemManager::findByCommand(cdb))
|
if (DebuggerItemManager::findByCommand(cdb))
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user