aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/debuggerruncontrol.cpp
diff options
context:
space:
mode:
authorhjk <[email protected]>2017-09-28 11:27:43 +0200
committerhjk <[email protected]>2017-09-29 14:12:54 +0000
commitaf63f488c2bdec64cceed4c9d9a70a152fb1fbdb (patch)
treef88daadcc2d1fa6616e7a09095aee36ccf536ed0 /src/plugins/debugger/debuggerruncontrol.cpp
parent6d919cd85a5c4d179da500bf62b8c091cd6c5106 (diff)
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 <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggerruncontrol.cpp')
-rw-r--r--src/plugins/debugger/debuggerruncontrol.cpp47
1 files changed, 23 insertions, 24 deletions
diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp
index 5d9870d8679..e5271453a52 100644
--- a/src/plugins/debugger/debuggerruncontrol.cpp
+++ b/src/plugins/debugger/debuggerruncontrol.cpp
@@ -76,7 +76,7 @@ enum { debug = 0 };
namespace Debugger {
namespace Internal {
-DebuggerEngine *createCdbEngine(QStringList *error, DebuggerStartMode sm);
+DebuggerEngine *createCdbEngine();
DebuggerEngine *createGdbEngine();
DebuggerEngine *createPdbEngine();
DebuggerEngine *createQmlEngine(bool useTerminal);
@@ -479,29 +479,28 @@ void DebuggerRunTool::start()
runControl()->setDisplayName(m_runParameters.displayName);
DebuggerEngine *cppEngine = nullptr;
-
- switch (m_runParameters.cppEngineType) {
- case GdbEngineType:
- cppEngine = createGdbEngine();
- break;
- case CdbEngineType: {
- QStringList errors;
- cppEngine = createCdbEngine(&errors, m_runParameters.startMode);
- if (!errors.isEmpty()) {
- reportFailure(errors.join('\n'));
- return;
- }
- }
- break;
- case LldbEngineType:
- cppEngine = createLldbEngine();
- break;
- case PdbEngineType: // FIXME: Yes, Python counts as C++...
- cppEngine = createPdbEngine();
- break;
- default:
- QTC_CHECK(false);
- break;
+ if (!m_engine) {
+ switch (m_runParameters.cppEngineType) {
+ case GdbEngineType:
+ cppEngine = createGdbEngine();
+ break;
+ case CdbEngineType:
+ if (!HostOsInfo::isWindowsHost()) {
+ reportFailure(tr("Unsupported CDB host system."));
+ return;
+ }
+ cppEngine = createCdbEngine();
+ break;
+ case LldbEngineType:
+ cppEngine = createLldbEngine();
+ break;
+ case PdbEngineType: // FIXME: Yes, Python counts as C++...
+ cppEngine = createPdbEngine();
+ break;
+ default:
+ QTC_CHECK(false);
+ break;
+ }
}
switch (m_runParameters.masterEngineType) {