From effa8a38da7cedb868391ecbf34bfdb0eb1e0198 Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Date: Mon, 14 Jun 2010 11:21:31 +0200
Subject: [PATCH] Windows compilation fix /
 97edcb7977ecea95613bf0c0e6030083549ca5f4

---
 src/plugins/debugger/cdb/cdbcom.h           |  6 +++--
 src/plugins/debugger/cdb/cdbdebugengine.cpp | 30 ++++++++++-----------
 src/plugins/debugger/debuggermanager.h      |  2 +-
 src/plugins/debugger/debuggerplugin.cpp     |  4 +--
 src/plugins/debugger/gdb/gdbengine.cpp      |  2 +-
 5 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/src/plugins/debugger/cdb/cdbcom.h b/src/plugins/debugger/cdb/cdbcom.h
index 5459d6a7dea..d11bcf10a34 100644
--- a/src/plugins/debugger/cdb/cdbcom.h
+++ b/src/plugins/debugger/cdb/cdbcom.h
@@ -30,7 +30,9 @@
 #ifndef CDBCOM_H
 #define CDBCOM_H
 
-#ifdef Q_OS_WINDOWS
+#include <QtCore/QtGlobal>
+
+#ifdef Q_OS_WIN
 
 #include <windows.h>
 #include <inc/dbgeng.h>
@@ -50,6 +52,6 @@ typedef IDebugBreakpoint2      CIDebugBreakpoint;
 
 #include "cdbcomstub.h"
 
-#endif // Q_OS_WINDOWS
+#endif // Q_OS_WIN
 
 #endif // CDBCOM_H
diff --git a/src/plugins/debugger/cdb/cdbdebugengine.cpp b/src/plugins/debugger/cdb/cdbdebugengine.cpp
index e6e2c523365..ae0dbceab27 100644
--- a/src/plugins/debugger/cdb/cdbdebugengine.cpp
+++ b/src/plugins/debugger/cdb/cdbdebugengine.cpp
@@ -388,9 +388,9 @@ void CdbDebugEngine::startupChecks()
 
 void CdbDebugEngine::startDebugger(const DebuggerRunControl *runControl)
 {
-    DebuggerStartParameters *sp = &runControl->sp();
+    const DebuggerStartParameters &sp = runControl->sp();
     if (debugCDBExecution)
-        qDebug() << "startDebugger" << *sp;
+        qDebug() << "startDebugger";
     CdbCore::BreakPoint::clearNormalizeFileNameCache();
     startupChecks();
     setState(AdapterStarting, Q_FUNC_INFO, __LINE__);
@@ -401,7 +401,7 @@ void CdbDebugEngine::startDebugger(const DebuggerRunControl *runControl)
         emit startFailed();
         return;
     }
-    switch (sp->startMode) {
+    switch (sp.startMode) {
     case AttachCore:
     case AttachToRemote:
         warning(QLatin1String("Internal error: Mode not supported."));
@@ -411,7 +411,7 @@ void CdbDebugEngine::startDebugger(const DebuggerRunControl *runControl)
     default:
         break;
     }
-    m_d->m_mode = sp->startMode;
+    m_d->m_mode = sp.startMode;
     m_d->clearDisplay();
     m_d->m_inferiorStartupComplete = false;
     setState(AdapterStarted, Q_FUNC_INFO, __LINE__);
@@ -448,28 +448,28 @@ void CdbDebugEngine::startDebugger(const DebuggerRunControl *runControl)
     switch (m_d->m_mode) {
     case AttachExternal:
     case AttachCrashedExternal:
-        rc = startAttachDebugger(sp->attachPID, m_d->m_mode, &errorMessage);
+        rc = startAttachDebugger(sp.attachPID, m_d->m_mode, &errorMessage);
         needWatchTimer = true; // Fetch away module load, etc. even if crashed
         break;
     case StartInternal:
     case StartExternal:
-        if (sp->useTerminal) {
+        if (sp.useTerminal) {
             // Attaching to console processes triggers an initial breakpoint, which we do not want
             m_d->m_ignoreInitialBreakPoint = true;
             // Launch console stub and wait for its startup
             m_d->m_consoleStubProc.stop(); // We leave the console open, so recycle it now.
-            m_d->m_consoleStubProc.setWorkingDirectory(sp->workingDirectory);
-            m_d->m_consoleStubProc.setEnvironment(sp->environment);
-            rc = m_d->m_consoleStubProc.start(sp->executable, sp->processArgs);
+            m_d->m_consoleStubProc.setWorkingDirectory(sp.workingDirectory);
+            m_d->m_consoleStubProc.setEnvironment(sp.environment);
+            rc = m_d->m_consoleStubProc.start(sp.executable, sp.processArgs);
             if (!rc)
-                errorMessage = tr("The console stub process was unable to start '%1'.").arg(sp->executable);
+                errorMessage = tr("The console stub process was unable to start '%1'.").arg(sp.executable);
             // continues in slotConsoleStubStarted()...
         } else {
             needWatchTimer = true;
-            rc = m_d->startDebuggerWithExecutable(sp->workingDirectory,
-                                                  sp->executable,
-                                                  sp->processArgs,
-                                                  sp->environment,
+            rc = m_d->startDebuggerWithExecutable(sp.workingDirectory,
+                                                  sp.executable,
+                                                  sp.processArgs,
+                                                  sp.environment,
                                                   &errorMessage);
         }
         break;
@@ -525,7 +525,7 @@ void CdbDebugEnginePrivate::processCreatedAttached(ULONG64 processHandle, ULONG6
     // the exception to be delivered to the debugger
     // Also, see special handling in slotModulesLoaded().
     if (m_mode == AttachCrashedExternal) {
-        const QString crashParameter = manager()->startParameters()->crashParameter;
+        const QString crashParameter = manager()->runControl()->sp().crashParameter;
         if (!crashParameter.isEmpty()) {
             ULONG64 evtNr = crashParameter.toULongLong();
             const HRESULT hr = interfaces().debugControl->SetNotifyEventHandle(evtNr);
diff --git a/src/plugins/debugger/debuggermanager.h b/src/plugins/debugger/debuggermanager.h
index 8011a65902d..f4e919b1f6d 100644
--- a/src/plugins/debugger/debuggermanager.h
+++ b/src/plugins/debugger/debuggermanager.h
@@ -321,7 +321,7 @@ signals:
 
 private:
     void init();
-    void runTest(const QString &fileName);
+    // void runTest(const QString &fileName);
     Q_SLOT void createNewDock(QWidget *widget);
 
     void aboutToShutdown();
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 4a7c8dc43e5..01b646c7a37 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -1060,8 +1060,8 @@ void DebuggerPlugin::extensionsInitialized()
     // time gdb -i mi -ex 'debuggerplugin.cpp:800' -ex r -ex q bin/qtcreator.bin
     const QByteArray env = qgetenv("QTC_DEBUGGER_TEST");
     //qDebug() << "EXTENSIONS INITIALIZED:" << env;
-    if (!env.isEmpty())
-        m_manager->runTest(QString::fromLocal8Bit(env));
+    // if (!env.isEmpty())
+    //    m_manager->runTest(QString::fromLocal8Bit(env));
     if (m_attachRemoteParameters.attachPid || !m_attachRemoteParameters.attachCore.isEmpty())
         QTimer::singleShot(0, this, SLOT(attachCmdLine()));
 
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 091821f8fcc..eea23c123cb 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -976,7 +976,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
                                   GdbResultDone)) {
 #ifdef Q_OS_WIN
         // Ignore spurious 'running' responses to 'attach'
-        const bool warning = !(m_startParameters->startMode == AttachExternal
+        const bool warning = !(manager()->runControl()->sp().startMode == AttachExternal
                                && cmd.command.startsWith("attach"));
 #else
         const bool warning = true;
-- 
GitLab