Windows compilation fix / 97edcb7977

This commit is contained in:
Friedemann Kleint
2010-06-14 11:21:31 +02:00
parent 81ab9585c3
commit effa8a38da
5 changed files with 23 additions and 21 deletions

View File

@@ -30,7 +30,9 @@
#ifndef CDBCOM_H #ifndef CDBCOM_H
#define CDBCOM_H #define CDBCOM_H
#ifdef Q_OS_WINDOWS #include <QtCore/QtGlobal>
#ifdef Q_OS_WIN
#include <windows.h> #include <windows.h>
#include <inc/dbgeng.h> #include <inc/dbgeng.h>
@@ -50,6 +52,6 @@ typedef IDebugBreakpoint2 CIDebugBreakpoint;
#include "cdbcomstub.h" #include "cdbcomstub.h"
#endif // Q_OS_WINDOWS #endif // Q_OS_WIN
#endif // CDBCOM_H #endif // CDBCOM_H

View File

@@ -388,9 +388,9 @@ void CdbDebugEngine::startupChecks()
void CdbDebugEngine::startDebugger(const DebuggerRunControl *runControl) void CdbDebugEngine::startDebugger(const DebuggerRunControl *runControl)
{ {
DebuggerStartParameters *sp = &runControl->sp(); const DebuggerStartParameters &sp = runControl->sp();
if (debugCDBExecution) if (debugCDBExecution)
qDebug() << "startDebugger" << *sp; qDebug() << "startDebugger";
CdbCore::BreakPoint::clearNormalizeFileNameCache(); CdbCore::BreakPoint::clearNormalizeFileNameCache();
startupChecks(); startupChecks();
setState(AdapterStarting, Q_FUNC_INFO, __LINE__); setState(AdapterStarting, Q_FUNC_INFO, __LINE__);
@@ -401,7 +401,7 @@ void CdbDebugEngine::startDebugger(const DebuggerRunControl *runControl)
emit startFailed(); emit startFailed();
return; return;
} }
switch (sp->startMode) { switch (sp.startMode) {
case AttachCore: case AttachCore:
case AttachToRemote: case AttachToRemote:
warning(QLatin1String("Internal error: Mode not supported.")); warning(QLatin1String("Internal error: Mode not supported."));
@@ -411,7 +411,7 @@ void CdbDebugEngine::startDebugger(const DebuggerRunControl *runControl)
default: default:
break; break;
} }
m_d->m_mode = sp->startMode; m_d->m_mode = sp.startMode;
m_d->clearDisplay(); m_d->clearDisplay();
m_d->m_inferiorStartupComplete = false; m_d->m_inferiorStartupComplete = false;
setState(AdapterStarted, Q_FUNC_INFO, __LINE__); setState(AdapterStarted, Q_FUNC_INFO, __LINE__);
@@ -448,28 +448,28 @@ void CdbDebugEngine::startDebugger(const DebuggerRunControl *runControl)
switch (m_d->m_mode) { switch (m_d->m_mode) {
case AttachExternal: case AttachExternal:
case AttachCrashedExternal: 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 needWatchTimer = true; // Fetch away module load, etc. even if crashed
break; break;
case StartInternal: case StartInternal:
case StartExternal: case StartExternal:
if (sp->useTerminal) { if (sp.useTerminal) {
// Attaching to console processes triggers an initial breakpoint, which we do not want // Attaching to console processes triggers an initial breakpoint, which we do not want
m_d->m_ignoreInitialBreakPoint = true; m_d->m_ignoreInitialBreakPoint = true;
// Launch console stub and wait for its startup // 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.stop(); // We leave the console open, so recycle it now.
m_d->m_consoleStubProc.setWorkingDirectory(sp->workingDirectory); m_d->m_consoleStubProc.setWorkingDirectory(sp.workingDirectory);
m_d->m_consoleStubProc.setEnvironment(sp->environment); m_d->m_consoleStubProc.setEnvironment(sp.environment);
rc = m_d->m_consoleStubProc.start(sp->executable, sp->processArgs); rc = m_d->m_consoleStubProc.start(sp.executable, sp.processArgs);
if (!rc) 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()... // continues in slotConsoleStubStarted()...
} else { } else {
needWatchTimer = true; needWatchTimer = true;
rc = m_d->startDebuggerWithExecutable(sp->workingDirectory, rc = m_d->startDebuggerWithExecutable(sp.workingDirectory,
sp->executable, sp.executable,
sp->processArgs, sp.processArgs,
sp->environment, sp.environment,
&errorMessage); &errorMessage);
} }
break; break;
@@ -525,7 +525,7 @@ void CdbDebugEnginePrivate::processCreatedAttached(ULONG64 processHandle, ULONG6
// the exception to be delivered to the debugger // the exception to be delivered to the debugger
// Also, see special handling in slotModulesLoaded(). // Also, see special handling in slotModulesLoaded().
if (m_mode == AttachCrashedExternal) { if (m_mode == AttachCrashedExternal) {
const QString crashParameter = manager()->startParameters()->crashParameter; const QString crashParameter = manager()->runControl()->sp().crashParameter;
if (!crashParameter.isEmpty()) { if (!crashParameter.isEmpty()) {
ULONG64 evtNr = crashParameter.toULongLong(); ULONG64 evtNr = crashParameter.toULongLong();
const HRESULT hr = interfaces().debugControl->SetNotifyEventHandle(evtNr); const HRESULT hr = interfaces().debugControl->SetNotifyEventHandle(evtNr);

View File

@@ -321,7 +321,7 @@ signals:
private: private:
void init(); void init();
void runTest(const QString &fileName); // void runTest(const QString &fileName);
Q_SLOT void createNewDock(QWidget *widget); Q_SLOT void createNewDock(QWidget *widget);
void aboutToShutdown(); void aboutToShutdown();

View File

@@ -1060,8 +1060,8 @@ void DebuggerPlugin::extensionsInitialized()
// time gdb -i mi -ex 'debuggerplugin.cpp:800' -ex r -ex q bin/qtcreator.bin // time gdb -i mi -ex 'debuggerplugin.cpp:800' -ex r -ex q bin/qtcreator.bin
const QByteArray env = qgetenv("QTC_DEBUGGER_TEST"); const QByteArray env = qgetenv("QTC_DEBUGGER_TEST");
//qDebug() << "EXTENSIONS INITIALIZED:" << env; //qDebug() << "EXTENSIONS INITIALIZED:" << env;
if (!env.isEmpty()) // if (!env.isEmpty())
m_manager->runTest(QString::fromLocal8Bit(env)); // m_manager->runTest(QString::fromLocal8Bit(env));
if (m_attachRemoteParameters.attachPid || !m_attachRemoteParameters.attachCore.isEmpty()) if (m_attachRemoteParameters.attachPid || !m_attachRemoteParameters.attachCore.isEmpty())
QTimer::singleShot(0, this, SLOT(attachCmdLine())); QTimer::singleShot(0, this, SLOT(attachCmdLine()));

View File

@@ -976,7 +976,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
GdbResultDone)) { GdbResultDone)) {
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
// Ignore spurious 'running' responses to 'attach' // 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")); && cmd.command.startsWith("attach"));
#else #else
const bool warning = true; const bool warning = true;