Debugger: Remove unneeded #ifdefs from CdbEngine.

Turn compile-time checks for host OS into runtime checks,
where possible.

Change-Id: I7ff26f6a49c0da4504427757b15959cdc193ee79
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
Christian Kandeler
2013-03-14 11:51:28 +01:00
parent 348db0b65f
commit 7a5f858358

View File

@@ -73,6 +73,7 @@
#include <utils/savedaction.h>
#include <utils/consoleprocess.h>
#include <utils/fileutils.h>
#include <utils/hostosinfo.h>
#include <cplusplus/findcdbbreakpoint.h>
#include <cplusplus/CppDocument.h>
@@ -332,27 +333,22 @@ static inline bool validMode(DebuggerStartMode sm)
// Accessed by RunControlFactory
DebuggerEngine *createCdbEngine(const DebuggerStartParameters &sp, QString *errorMessage)
{
#ifdef Q_OS_WIN
CdbOptionsPage *op = CdbOptionsPage::instance();
if (!op || !op->options()->isValid() || !validMode(sp.startMode)) {
*errorMessage = QLatin1String("Internal error: Invalid start parameters passed for thre CDB engine.");
return 0;
if (Utils::HostOsInfo::isWindowsHost()) {
CdbOptionsPage *op = CdbOptionsPage::instance();
if (!op || !op->options()->isValid() || !validMode(sp.startMode)) {
*errorMessage = QLatin1String("Internal error: Invalid start parameters passed for thee CDB engine.");
return 0;
}
return new CdbEngine(sp, op->options());
}
return new CdbEngine(sp, op->options());
#else
Q_UNUSED(sp)
#endif
*errorMessage = QString::fromLatin1("Unsupported debug mode");
return 0;
}
void addCdbOptionPages(QList<Core::IOptionsPage *> *opts)
{
#ifdef Q_OS_WIN
opts->push_back(new CdbOptionsPage);
#else
Q_UNUSED(opts);
#endif
if (Utils::HostOsInfo::isWindowsHost())
opts->push_back(new CdbOptionsPage);
}
#define QT_CREATOR_CDB_EXT "qtcreatorcdbext"