forked from qt-creator/qt-creator
Create RunConfiguration specific DebugWorkerFactories
Instead of relying on the DebuggerRunWorkerFactory to match for all RunConfiguration, every plugin needs to create a WorkerFactory for its own RunConfiguration. Similar to the SimpleTargetRunnerFactory there is now a SimpleDebugRunnerFactory which makes the setup easy. Change-Id: I25aaabcd70f7ac649baeab4eb4c7e88d53dac91e Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "debuggerengine.h"
|
||||
#include "terminal.h"
|
||||
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
|
||||
|
||||
@@ -160,6 +161,19 @@ public:
|
||||
DebuggerRunWorkerFactory();
|
||||
};
|
||||
|
||||
class SimpleDebugRunnerFactory final : public ProjectExplorer::RunWorkerFactory
|
||||
{
|
||||
public:
|
||||
explicit SimpleDebugRunnerFactory(const QList<Utils::Id> &runConfigs, const QList<Utils::Id> &extraRunModes = {})
|
||||
{
|
||||
cloneProduct(Constants::DEBUGGER_RUN_FACTORY);
|
||||
addSupportedRunMode(ProjectExplorer::Constants::DEBUG_RUN_MODE);
|
||||
for (const Utils::Id &id : extraRunModes)
|
||||
addSupportedRunMode(id);
|
||||
setSupportedRunConfigs(runConfigs);
|
||||
}
|
||||
};
|
||||
|
||||
extern DEBUGGER_EXPORT const char DebugServerRunnerWorkerId[];
|
||||
extern DEBUGGER_EXPORT const char GdbServerPortGathererWorkerId[];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user