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,7 +636,9 @@ void DebuggerItemManagerPrivate::autoDetectCdbDebuggers()
|
||||
QString::fromLocal8Bit(qgetenv("ProgramW6432"))
|
||||
};
|
||||
|
||||
for (const QString &dirName: programDirs) {
|
||||
QFileInfoList kitFolders;
|
||||
|
||||
for (const QString &dirName : programDirs) {
|
||||
if (dirName.isEmpty())
|
||||
continue;
|
||||
const QDir dir(dirName);
|
||||
@@ -647,18 +649,8 @@ void DebuggerItemManagerPrivate::autoDetectCdbDebuggers()
|
||||
QDir windowKitsFolder = dir;
|
||||
if (windowKitsFolder.cd(windowsKitsFolderName)) {
|
||||
// Check in reverse order (latest first)
|
||||
const QFileInfoList kitFolders =
|
||||
windowKitsFolder.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot,
|
||||
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()));
|
||||
}
|
||||
kitFolders.append(windowKitsFolder.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot,
|
||||
QDir::Time | QDir::Reversed));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)) {
|
||||
if (DebuggerItemManager::findByCommand(cdb))
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user