diff options
| author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-03-23 13:00:09 +0100 |
|---|---|---|
| committer | hjk <qthjk@ovi.com> | 2012-03-23 13:11:50 +0100 |
| commit | 818bb51b0841dabe0561956c4579c2be8206d22e (patch) | |
| tree | df251aeebcedc72d70ab0f4fd43179b3a94832bc /src/plugins/projectexplorer/msvctoolchain.cpp | |
| parent | 1d81709a033b956e959ccb831365d7cadc049025 (diff) | |
| download | qt-creator-818bb51b0841dabe0561956c4579c2be8206d22e.tar.gz | |
Autodetect CDB's shipped with Windows Kits >= 8.0.
Task-number: QTCREATORBUG-7182
Change-Id: I153788664067445cece3c7ecf46cf8217539251d
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Diffstat (limited to 'src/plugins/projectexplorer/msvctoolchain.cpp')
| -rw-r--r-- | src/plugins/projectexplorer/msvctoolchain.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index a73f04eb95..74e0f1ffae 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -45,6 +45,7 @@ #include <utils/qtcassert.h> #include <QDir> +#include <QFileInfo> #include <QProcess> #include <QSettings> #include <QUrl> @@ -646,6 +647,7 @@ QList<ToolChain *> MsvcToolChainFactory::autoDetect() return results; } +// Detect CDB, return a pair of <32bit, 64bit> executables. QPair<Utils::FileName, Utils::FileName> MsvcToolChain::autoDetectCdbDebugger() { QPair<Utils::FileName, Utils::FileName> result; @@ -660,6 +662,29 @@ QPair<Utils::FileName, Utils::FileName> MsvcToolChain::autoDetectCdbDebugger() if (dirName.isEmpty()) continue; QDir dir(dirName); + // Windows SDK's starting from version 8 live in + // "ProgramDir\Windows Kits\<version>" + const QString windowsKitsFolderName = QLatin1String("Windows Kits"); + if (dir.exists(windowsKitsFolderName)) { + 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); + foreach (const QFileInfo &kitFolderFi, kitFolders) { + const QString path = kitFolderFi.absoluteFilePath(); + const QFileInfo cdb32(path + QLatin1String("/Debuggers/x86/cdb.exe")); + if (cdb32.isExecutable()) + cdbs.push_back(Utils::FileName::fromString(cdb32.absoluteFilePath())); + const QFileInfo cdb64(path + QLatin1String("/Debuggers/x64/cdb.exe")); + if (cdb64.isExecutable()) + cdbs.push_back(Utils::FileName::fromString(cdb64.absoluteFilePath())); + } // for Kits + } // can cd to "Windows Kits" + } // "Windows Kits" exists + + // Pre Windows SDK 8: Check 'Debugging Tools for Windows' foreach (const QFileInfo &fi, dir.entryInfoList(QStringList(QLatin1String("Debugging Tools for Windows*")), QDir::Dirs | QDir::NoDotAndDotDot)) { Utils::FileName filePath(fi); |
