BareMetal: Use runnable() to get executable and arguments

... rather than accessing the aspects directly.

Task-number: QTCREATORBUG-30925
Change-Id: Id39b6226f6bbee75b93905747373513294deb29e
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2024-06-05 13:23:50 +02:00
parent 345ae8e4d4
commit 5221d53a6d
2 changed files with 4 additions and 12 deletions

View File

@@ -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<ExecutableAspect>();
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<ArgumentsAspect>())
inferior.command.setArguments(argAspect->arguments);
inferior.command.setArguments(runnable.command.arguments());
runTool->setInferior(inferior);
runTool->setSymbolFile(bin);
runTool->setStartMode(AttachToRemoteServer);

View File

@@ -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<ExecutableAspect>();
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;