From 5221d53a6d42e656feb922b83650edde34949a43 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 5 Jun 2024 13:23:50 +0200 Subject: [PATCH] BareMetal: Use runnable() to get executable and arguments ... rather than accessing the aspects directly. Task-number: QTCREATORBUG-30925 Change-Id: Id39b6226f6bbee75b93905747373513294deb29e Reviewed-by: hjk --- .../baremetal/debugservers/gdb/gdbserverprovider.cpp | 10 +++------- .../baremetal/debugservers/uvsc/uvscserverprovider.cpp | 6 +----- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp index 885e20fac42..773a2ac577f 100644 --- a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp @@ -138,11 +138,8 @@ bool GdbServerProvider::isValid() const bool GdbServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessage) const { QTC_ASSERT(runTool, return false); - const RunControl *runControl = runTool->runControl(); - const auto exeAspect = runControl->aspectData(); - QTC_ASSERT(exeAspect, return false); - - const FilePath bin = FilePath::fromString(exeAspect->executable.path()); + const ProcessRunData runnable = runTool->runControl()->runnable(); + const FilePath bin = FilePath::fromString(runnable.command.executable().path()); if (bin.isEmpty()) { errorMessage = Tr::tr("Cannot debug: Local executable is not set."); return false; @@ -155,8 +152,7 @@ bool GdbServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessa ProcessRunData inferior; inferior.command.setExecutable(bin); - if (const auto argAspect = runControl->aspectData()) - inferior.command.setArguments(argAspect->arguments); + inferior.command.setArguments(runnable.command.arguments()); runTool->setInferior(inferior); runTool->setSymbolFile(bin); runTool->setStartMode(AttachToRemoteServer); diff --git a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp index 3709736d842..4dac9b654c4 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp @@ -168,11 +168,7 @@ QString UvscServerProvider::channelString() const bool UvscServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessage) const { QTC_ASSERT(runTool, return false); - const RunControl *runControl = runTool->runControl(); - const auto exeAspect = runControl->aspectData(); - QTC_ASSERT(exeAspect, return false); - - const FilePath bin = exeAspect->executable; + const FilePath bin = runTool->runControl()->runnable().command.executable(); if (bin.isEmpty()) { errorMessage = Tr::tr("Cannot debug: Local executable is not set."); return false;