diff --git a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp index 2486ef3ecef..d103e86c0a8 100644 --- a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp @@ -179,8 +179,6 @@ bool GdbServerProvider::aboutToRun(DebuggerRunTool *runTool, Runnable inferior; inferior.command.setExecutable(bin); - inferior.extraData.insert(Debugger::Constants::kPeripheralDescriptionFile, - m_peripheralDescriptionFile.toVariant()); if (const auto argAspect = runControl->aspect()) inferior.command.setArguments(argAspect->arguments); runTool->setInferior(inferior); @@ -191,6 +189,7 @@ bool GdbServerProvider::aboutToRun(DebuggerRunTool *runTool, runTool->setRemoteChannel(channelString()); runTool->setUseContinueInsteadOfRun(true); runTool->setUseExtendedRemote(useExtendedRemote()); + runTool->runParameters().peripheralDescriptionFile = m_peripheralDescriptionFile; return true; } diff --git a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp index 19c4b07ad55..ed0c419e87e 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp @@ -216,11 +216,10 @@ bool UvscServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMess Runnable inferior; inferior.command.setExecutable(bin); - inferior.extraData.insert(Debugger::Constants::kPeripheralDescriptionFile, - peripheralDescriptionFile.toVariant()); - inferior.extraData.insert(Debugger::Constants::kUVisionProjectFilePath, projFilePath.toString()); - inferior.extraData.insert(Debugger::Constants::kUVisionOptionsFilePath, optFilePath.toString()); - inferior.extraData.insert(Debugger::Constants::kUVisionSimulator, isSimulator()); + runTool->runParameters().peripheralDescriptionFile = peripheralDescriptionFile; + runTool->runParameters().uVisionProjectFilePath = projFilePath; + runTool->runParameters().uVisionOptionsFilePath = optFilePath; + runTool->runParameters().uVisionSimulator = isSimulator(); runTool->setInferior(inferior); runTool->setSymbolFile(bin); runTool->setStartMode(AttachToRemoteServer); diff --git a/src/plugins/debugger/debuggerconstants.h b/src/plugins/debugger/debuggerconstants.h index 74ccf23e430..09ffe19365a 100644 --- a/src/plugins/debugger/debuggerconstants.h +++ b/src/plugins/debugger/debuggerconstants.h @@ -36,14 +36,6 @@ const char MODE_DEBUG[] = "Mode.Debug"; // Debug mode context const char C_DEBUGMODE[] = "Debugger.DebugMode"; -// Common debugger constants. -const char kPeripheralDescriptionFile[] = "PeripheralDescriptionFile"; - -// UVSC-specific debugger constants. -const char kUVisionProjectFilePath[] = "UVisionProjectFilePath"; -const char kUVisionOptionsFilePath[] = "UVisionOptionsFilePath"; -const char kUVisionSimulator[] = "UVisionSimulator"; - } // namespace Constants // Keep in sync with dumper.py diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index 34830aafaca..4205384cd99 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -206,6 +206,14 @@ public: Utils::FilePath dumperPath; int fallbackQtVersion = 0x50200; + + // Common debugger constants. + Utils::FilePath peripheralDescriptionFile; + + // UVSC-specific debugger constants. + Utils::FilePath uVisionProjectFilePath; + Utils::FilePath uVisionOptionsFilePath; + bool uVisionSimulator = false; }; class UpdateParameters diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h index 4781a059366..a58ffaff9f6 100644 --- a/src/plugins/debugger/debuggerruncontrol.h +++ b/src/plugins/debugger/debuggerruncontrol.h @@ -131,6 +131,8 @@ public: Internal::TerminalRunner *terminalRunner() const; DebuggerEngineType cppEngineType() const; + Internal::DebuggerRunParameters &runParameters() { return m_runParameters; } + private: bool fixupParameters(); void handleEngineStarted(Internal::DebuggerEngine *engine); diff --git a/src/plugins/debugger/peripheralregisterhandler.cpp b/src/plugins/debugger/peripheralregisterhandler.cpp index 5c63c156cae..b1748d3b986 100644 --- a/src/plugins/debugger/peripheralregisterhandler.cpp +++ b/src/plugins/debugger/peripheralregisterhandler.cpp @@ -732,12 +732,9 @@ void PeripheralRegisterHandler::updateRegisterGroups() clear(); const DebuggerRunParameters &rp = m_engine->runParameters(); - const FilePath peripheralDescriptionFile = FilePath::fromVariant( - rp.inferior.extraData.value(Debugger::Constants::kPeripheralDescriptionFile)); - - if (!peripheralDescriptionFile.exists()) + if (!rp.peripheralDescriptionFile.exists()) return; - m_peripheralRegisterGroups = availablePeripheralRegisterGroups(peripheralDescriptionFile); + m_peripheralRegisterGroups = availablePeripheralRegisterGroups(rp.peripheralDescriptionFile); } void PeripheralRegisterHandler::updateRegister(quint64 address, quint64 value) diff --git a/src/plugins/debugger/uvsc/uvscengine.cpp b/src/plugins/debugger/uvsc/uvscengine.cpp index 915a6c970bd..6a6253c9dc9 100644 --- a/src/plugins/debugger/uvsc/uvscengine.cpp +++ b/src/plugins/debugger/uvsc/uvscengine.cpp @@ -536,10 +536,8 @@ void UvscEngine::updateAll() bool UvscEngine::configureProject(const DebuggerRunParameters &rp) { // Fetch patchs for the generated uVision project files. - const FilePath optionsPath = FilePath::fromString(rp.inferior.extraData.value( - Constants::kUVisionOptionsFilePath).toString()); - const FilePath projectPath = FilePath::fromString(rp.inferior.extraData.value( - Constants::kUVisionProjectFilePath).toString()); + const FilePath optionsPath = rp.uVisionOptionsFilePath; + const FilePath projectPath = rp.uVisionProjectFilePath; showMessage("UVSC: LOADING PROJECT..."); if (!optionsPath.exists()) { @@ -557,7 +555,7 @@ bool UvscEngine::configureProject(const DebuggerRunParameters &rp) } showMessage("UVSC: SETTING PROJECT DEBUG TARGET..."); - m_simulator = rp.inferior.extraData.value(Constants::kUVisionSimulator).toBool(); + m_simulator = rp.uVisionSimulator; if (!m_client->setProjectDebugTarget(m_simulator)) { handleSetupFailure(tr("Internal error: Unable to set the uVision debug target: %1.") .arg(m_client->errorString())); @@ -606,8 +604,7 @@ void UvscEngine::handleProjectClosed() m_loadingRequired = false; const DebuggerRunParameters &rp = runParameters(); - const FilePath projectPath = FilePath::fromString(rp.inferior.extraData.value( - Constants::kUVisionProjectFilePath).toString()); + const FilePath projectPath = rp.uVisionProjectFilePath; // This magic function removes specific files from the uVision // project directory. Without of this we can't enumerate the local