Debugger: Simplify CdbEngine construction

Moving the knowledge that this won't work well outside windows
kind of decreases encapsulation, but that's not really worth the
complication of the error handling here.

Change-Id: Idcb6f6d64f33ee8c49a01e62e20aad16d3f01b86
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2017-09-28 11:27:43 +02:00
parent 6d919cd85a
commit af63f488c2
2 changed files with 26 additions and 39 deletions

View File

@@ -194,22 +194,10 @@ public:
CdbEngine::CommandHandler handler;
};
static inline bool validMode(DebuggerStartMode sm)
// Accessed by DebuggerRunTool
DebuggerEngine *createCdbEngine()
{
return sm != NoStartMode;
}
// Accessed by RunControlFactory
DebuggerEngine *createCdbEngine(QStringList *errors, DebuggerStartMode sm)
{
if (HostOsInfo::isWindowsHost()) {
if (validMode(sm))
return new CdbEngine();
errors->append(CdbEngine::tr("Internal error: Invalid start parameters passed for the CDB engine."));
} else {
errors->append(CdbEngine::tr("Unsupported CDB host system."));
}
return 0;
return new CdbEngine;
}
void addCdbOptionPages(QList<Core::IOptionsPage *> *opts)