OSDN Git Service

cdb: Be a bit more robust when detecting debuggin tools for win, 64 bit.
authorDaniel Molkentin <daniel.molkentin@nokia.com>
Fri, 12 Jun 2009 13:11:28 +0000 (15:11 +0200)
committerDaniel Molkentin <daniel.molkentin@nokia.com>
Fri, 12 Jun 2009 13:11:42 +0000 (15:11 +0200)
It seems like some versions install with the postfix " 64-bit." The
change also makes it easier to add new postfixes.

Reviewed-by: owolff
src/plugins/debugger/cdb/cdb.pri
src/plugins/debugger/cdb/cdboptions.cpp

index f82495a..009b97b 100644 (file)
@@ -14,6 +14,10 @@ CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows/sdk"
   CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows (x64)/sdk"
 }
 
+!exists ($$CDB_PATH) {
+  CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows 64-bit/sdk"
+}
+
 exists ($$CDB_PATH) {
 message("Experimental: Adding support for $$CDB_PATH")
 
index 0aba1a8..29acafc 100644 (file)
@@ -86,7 +86,11 @@ bool CdbOptions::autoDetectPath(QString *outPath, QStringList *checkedDirectorie
     // Look for $ProgramFiles/"Debugging Tools For Windows <bit-idy>" and its
     // " (x86)", " (x64)" variations. Qt Creator needs 64/32 bit depending
     // on how it was built.
-    static const char *postFixes[] = { " (x86)", " (x32)", " (x64)" };
+#ifdef Q_OS_WIN64
+    static const char *postFixes[] = {" (x64)", " 64-bit" };
+#else
+    static const char *postFixes[] = { " (x86)", " (x32)" };
+#endif
 
     outPath->clear();
     const QByteArray programDirB = qgetenv("ProgramFiles");
@@ -94,11 +98,7 @@ bool CdbOptions::autoDetectPath(QString *outPath, QStringList *checkedDirectorie
         return false;
 
     const QString programDir = QString::fromLocal8Bit(programDirB) + QDir::separator();
-#ifdef Q_OS_WIN64
-    const QString installDir = QLatin1String("Debugging Tools For Windows (x64)");
-#else
     const QString installDir = QLatin1String("Debugging Tools For Windows");
-#endif
 
     QString path = programDir + installDir;
     if (checkedDirectories)