From ee8c43c23753b17bdf0116890397bdf8eccba3e5 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 13 Jan 2025 18:06:15 +0100 Subject: [PATCH] Debugger: Transform remaining fields of DebuggerRunParameters Transform peripheralDescriptionFile and UVision-related. Task-number: QTCREATORBUG-29168 Change-Id: I360f9370be4e8d7c80f09374fbe7ed4be4a73ad5 Reviewed-by: hjk --- .../debugservers/gdb/gdbserverprovider.cpp | 2 +- .../debugservers/uvsc/uvscserverprovider.cpp | 8 +++---- src/plugins/debugger/debuggerengine.h | 21 +++++++++++++------ .../debugger/peripheralregisterhandler.cpp | 4 ++-- src/plugins/debugger/uvsc/uvscengine.cpp | 8 +++---- 5 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp index a612c74be69..642e9efb5d7 100644 --- a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp @@ -151,7 +151,7 @@ bool GdbServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessa rp.setRemoteChannel(channelString()); rp.setUseContinueInsteadOfRun(true); rp.setUseExtendedRemote(useExtendedRemote()); - rp.peripheralDescriptionFile = m_peripheralDescriptionFile; + rp.setPeripheralDescriptionFile(m_peripheralDescriptionFile); return true; } diff --git a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp index f6f7d961e1f..bb33df5f4cf 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp @@ -185,10 +185,10 @@ bool UvscServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMess ProcessRunData inferior; inferior.command.setExecutable(bin); DebuggerRunParameters &rp = runTool->runParameters(); - rp.peripheralDescriptionFile = peripheralDescriptionFile; - rp.uVisionProjectFilePath = projFilePath; - rp.uVisionOptionsFilePath = optFilePath; - rp.uVisionSimulator = isSimulator(); + rp.setPeripheralDescriptionFile(peripheralDescriptionFile); + rp.setUVisionProjectFilePath(projFilePath); + rp.setUVisionOptionsFilePath(optFilePath); + rp.setUVisionSimulator(isSimulator()); rp.setInferior(inferior); rp.setSymbolFile(bin); rp.setStartMode(AttachToRemoteServer); diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index 026df9b5c66..b1eff543d5f 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -244,13 +244,17 @@ public: int qtVersion() const { return m_qtVersion; } QString qtNamespace() const { return m_qtNamespace; }; - // Common debugger constants. - Utils::FilePath peripheralDescriptionFile; + void setPeripheralDescriptionFile(const Utils::FilePath &path) { m_peripheralDescriptionFile = path; } + Utils::FilePath peripheralDescriptionFile() const { return m_peripheralDescriptionFile; } - // UVSC-specific debugger constants. - Utils::FilePath uVisionProjectFilePath; - Utils::FilePath uVisionOptionsFilePath; - bool uVisionSimulator = false; + void setUVisionProjectFilePath(const Utils::FilePath &path) { m_uVisionProjectFilePath = path; } + Utils::FilePath uVisionProjectFilePath() const { return m_uVisionProjectFilePath; } + + void setUVisionOptionsFilePath(const Utils::FilePath &path) { m_uVisionOptionsFilePath = path; } + Utils::FilePath uVisionOptionsFilePath() const { return m_uVisionOptionsFilePath; } + + void setUVisionSimulator(bool on) { m_uVisionSimulator = on; } + bool uVisionSimulator() const { return m_uVisionSimulator; } private: DebuggerStartMode m_startMode = NoStartMode; @@ -339,6 +343,11 @@ private: int m_qtVersion = 0; QString m_qtNamespace; + + Utils::FilePath m_peripheralDescriptionFile; // Common debugger constant. + Utils::FilePath m_uVisionProjectFilePath; // UVSC-specific debugger constant. + Utils::FilePath m_uVisionOptionsFilePath; // UVSC-specific debugger constant. + bool m_uVisionSimulator = false; }; namespace Internal { diff --git a/src/plugins/debugger/peripheralregisterhandler.cpp b/src/plugins/debugger/peripheralregisterhandler.cpp index 23c40a9cc79..8288e942094 100644 --- a/src/plugins/debugger/peripheralregisterhandler.cpp +++ b/src/plugins/debugger/peripheralregisterhandler.cpp @@ -625,9 +625,9 @@ void PeripheralRegisterHandler::updateRegisterGroups() clear(); const DebuggerRunParameters &rp = m_engine->runParameters(); - if (!rp.peripheralDescriptionFile.exists()) + if (!rp.peripheralDescriptionFile().exists()) return; - m_peripheralRegisterGroups = availablePeripheralRegisterGroups(rp.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 1975ea5f93a..2125122d9ac 100644 --- a/src/plugins/debugger/uvsc/uvscengine.cpp +++ b/src/plugins/debugger/uvsc/uvscengine.cpp @@ -514,8 +514,8 @@ void UvscEngine::updateAll() bool UvscEngine::configureProject(const DebuggerRunParameters &rp) { // Fetch patchs for the generated uVision project files. - const FilePath optionsPath = rp.uVisionOptionsFilePath; - const FilePath projectPath = rp.uVisionProjectFilePath; + const FilePath optionsPath = rp.uVisionOptionsFilePath(); + const FilePath projectPath = rp.uVisionProjectFilePath(); showMessage("UVSC: LOADING PROJECT..."); if (!optionsPath.exists()) { @@ -533,7 +533,7 @@ bool UvscEngine::configureProject(const DebuggerRunParameters &rp) } showMessage("UVSC: SETTING PROJECT DEBUG TARGET..."); - m_simulator = rp.uVisionSimulator; + m_simulator = rp.uVisionSimulator(); if (!m_client->setProjectDebugTarget(m_simulator)) { handleSetupFailure(Tr::tr("Internal error: Unable to set the uVision debug target: %1.") .arg(m_client->errorString())); @@ -582,7 +582,7 @@ void UvscEngine::handleProjectClosed() m_loadingRequired = false; const DebuggerRunParameters &rp = runParameters(); - const FilePath projectPath = rp.uVisionProjectFilePath; + 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