Debugger: Transform remaining fields of DebuggerRunParameters

Transform peripheralDescriptionFile and UVision-related.

Task-number: QTCREATORBUG-29168
Change-Id: I360f9370be4e8d7c80f09374fbe7ed4be4a73ad5
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2025-01-13 18:06:15 +01:00
parent 2d79c1b266
commit ee8c43c237
5 changed files with 26 additions and 17 deletions

View File

@@ -151,7 +151,7 @@ bool GdbServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessa
rp.setRemoteChannel(channelString()); rp.setRemoteChannel(channelString());
rp.setUseContinueInsteadOfRun(true); rp.setUseContinueInsteadOfRun(true);
rp.setUseExtendedRemote(useExtendedRemote()); rp.setUseExtendedRemote(useExtendedRemote());
rp.peripheralDescriptionFile = m_peripheralDescriptionFile; rp.setPeripheralDescriptionFile(m_peripheralDescriptionFile);
return true; return true;
} }

View File

@@ -185,10 +185,10 @@ bool UvscServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMess
ProcessRunData inferior; ProcessRunData inferior;
inferior.command.setExecutable(bin); inferior.command.setExecutable(bin);
DebuggerRunParameters &rp = runTool->runParameters(); DebuggerRunParameters &rp = runTool->runParameters();
rp.peripheralDescriptionFile = peripheralDescriptionFile; rp.setPeripheralDescriptionFile(peripheralDescriptionFile);
rp.uVisionProjectFilePath = projFilePath; rp.setUVisionProjectFilePath(projFilePath);
rp.uVisionOptionsFilePath = optFilePath; rp.setUVisionOptionsFilePath(optFilePath);
rp.uVisionSimulator = isSimulator(); rp.setUVisionSimulator(isSimulator());
rp.setInferior(inferior); rp.setInferior(inferior);
rp.setSymbolFile(bin); rp.setSymbolFile(bin);
rp.setStartMode(AttachToRemoteServer); rp.setStartMode(AttachToRemoteServer);

View File

@@ -244,13 +244,17 @@ public:
int qtVersion() const { return m_qtVersion; } int qtVersion() const { return m_qtVersion; }
QString qtNamespace() const { return m_qtNamespace; }; QString qtNamespace() const { return m_qtNamespace; };
// Common debugger constants. void setPeripheralDescriptionFile(const Utils::FilePath &path) { m_peripheralDescriptionFile = path; }
Utils::FilePath peripheralDescriptionFile; Utils::FilePath peripheralDescriptionFile() const { return m_peripheralDescriptionFile; }
// UVSC-specific debugger constants. void setUVisionProjectFilePath(const Utils::FilePath &path) { m_uVisionProjectFilePath = path; }
Utils::FilePath uVisionProjectFilePath; Utils::FilePath uVisionProjectFilePath() const { return m_uVisionProjectFilePath; }
Utils::FilePath uVisionOptionsFilePath;
bool uVisionSimulator = false; 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: private:
DebuggerStartMode m_startMode = NoStartMode; DebuggerStartMode m_startMode = NoStartMode;
@@ -339,6 +343,11 @@ private:
int m_qtVersion = 0; int m_qtVersion = 0;
QString m_qtNamespace; 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 { namespace Internal {

View File

@@ -625,9 +625,9 @@ void PeripheralRegisterHandler::updateRegisterGroups()
clear(); clear();
const DebuggerRunParameters &rp = m_engine->runParameters(); const DebuggerRunParameters &rp = m_engine->runParameters();
if (!rp.peripheralDescriptionFile.exists()) if (!rp.peripheralDescriptionFile().exists())
return; return;
m_peripheralRegisterGroups = availablePeripheralRegisterGroups(rp.peripheralDescriptionFile); m_peripheralRegisterGroups = availablePeripheralRegisterGroups(rp.peripheralDescriptionFile());
} }
void PeripheralRegisterHandler::updateRegister(quint64 address, quint64 value) void PeripheralRegisterHandler::updateRegister(quint64 address, quint64 value)

View File

@@ -514,8 +514,8 @@ void UvscEngine::updateAll()
bool UvscEngine::configureProject(const DebuggerRunParameters &rp) bool UvscEngine::configureProject(const DebuggerRunParameters &rp)
{ {
// Fetch patchs for the generated uVision project files. // Fetch patchs for the generated uVision project files.
const FilePath optionsPath = rp.uVisionOptionsFilePath; const FilePath optionsPath = rp.uVisionOptionsFilePath();
const FilePath projectPath = rp.uVisionProjectFilePath; const FilePath projectPath = rp.uVisionProjectFilePath();
showMessage("UVSC: LOADING PROJECT..."); showMessage("UVSC: LOADING PROJECT...");
if (!optionsPath.exists()) { if (!optionsPath.exists()) {
@@ -533,7 +533,7 @@ bool UvscEngine::configureProject(const DebuggerRunParameters &rp)
} }
showMessage("UVSC: SETTING PROJECT DEBUG TARGET..."); showMessage("UVSC: SETTING PROJECT DEBUG TARGET...");
m_simulator = rp.uVisionSimulator; m_simulator = rp.uVisionSimulator();
if (!m_client->setProjectDebugTarget(m_simulator)) { if (!m_client->setProjectDebugTarget(m_simulator)) {
handleSetupFailure(Tr::tr("Internal error: Unable to set the uVision debug target: %1.") handleSetupFailure(Tr::tr("Internal error: Unable to set the uVision debug target: %1.")
.arg(m_client->errorString())); .arg(m_client->errorString()));
@@ -582,7 +582,7 @@ void UvscEngine::handleProjectClosed()
m_loadingRequired = false; m_loadingRequired = false;
const DebuggerRunParameters &rp = runParameters(); const DebuggerRunParameters &rp = runParameters();
const FilePath projectPath = rp.uVisionProjectFilePath; const FilePath projectPath = rp.uVisionProjectFilePath();
// This magic function removes specific files from the uVision // This magic function removes specific files from the uVision
// project directory. Without of this we can't enumerate the local // project directory. Without of this we can't enumerate the local