DAP: Add engine chooser

The Engine Chooser empowers users to select the desired
debugging engine when initiating DAP debugging sessions.

Change-Id: I070ff2620b318494ee715c5ac369765d4a9dc616
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Artem Sokolovskii
2023-08-18 15:17:11 +02:00
parent b80cef815e
commit d304e82e63
15 changed files with 300 additions and 95 deletions

View File

@@ -440,6 +440,7 @@ public:
DebuggerEngine *m_engine = nullptr; // Not owned.
QString m_runId;
QString m_debuggerName;
QString m_debuggerType;
QPointer<Perspective> m_perspective;
DebuggerRunParameters m_runParameters;
IDevice::ConstPtr m_device;
@@ -728,6 +729,8 @@ void DebuggerEnginePrivate::setupViews()
if (!currentPerspective || currentPerspective->id() == Constants::PRESET_PERSPECTIVE_ID)
m_perspective->useSubPerspectiveSwitcher(EngineManager::engineChooser());
else
m_perspective->useSubPerspectiveSwitcher(EngineManager::dapEngineChooser());
m_perspective->addToolBarAction(&m_continueAction);
m_perspective->addToolBarAction(&m_interruptAction);
@@ -872,6 +875,16 @@ QString DebuggerEngine::debuggerName() const
return d->m_debuggerName;
}
void DebuggerEngine::setDebuggerType(const QString &type)
{
d->m_debuggerType = type;
}
QString DebuggerEngine::debuggerType() const
{
return d->m_debuggerType;
}
QString DebuggerEngine::stateName(int s)
{
# define SN(x) case x: return QLatin1String(#x);
@@ -2590,7 +2603,6 @@ bool DebuggerRunParameters::isCppDebugging() const
return cppEngineType == GdbEngineType
|| cppEngineType == LldbEngineType
|| cppEngineType == CdbEngineType
|| cppEngineType == DapEngineType
|| cppEngineType == UvscEngineType;
}