forked from qt-creator/qt-creator
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:
@@ -138,11 +138,8 @@ bool GdbServerProvider::isValid() const
|
|||||||
bool GdbServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessage) const
|
bool GdbServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessage) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(runTool, return false);
|
QTC_ASSERT(runTool, return false);
|
||||||
const RunControl *runControl = runTool->runControl();
|
const ProcessRunData runnable = runTool->runControl()->runnable();
|
||||||
const auto exeAspect = runControl->aspectData<ExecutableAspect>();
|
const FilePath bin = FilePath::fromString(runnable.command.executable().path());
|
||||||
QTC_ASSERT(exeAspect, return false);
|
|
||||||
|
|
||||||
const FilePath bin = FilePath::fromString(exeAspect->executable.path());
|
|
||||||
if (bin.isEmpty()) {
|
if (bin.isEmpty()) {
|
||||||
errorMessage = Tr::tr("Cannot debug: Local executable is not set.");
|
errorMessage = Tr::tr("Cannot debug: Local executable is not set.");
|
||||||
return false;
|
return false;
|
||||||
@@ -155,8 +152,7 @@ bool GdbServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessa
|
|||||||
|
|
||||||
ProcessRunData inferior;
|
ProcessRunData inferior;
|
||||||
inferior.command.setExecutable(bin);
|
inferior.command.setExecutable(bin);
|
||||||
if (const auto argAspect = runControl->aspectData<ArgumentsAspect>())
|
inferior.command.setArguments(runnable.command.arguments());
|
||||||
inferior.command.setArguments(argAspect->arguments);
|
|
||||||
runTool->setInferior(inferior);
|
runTool->setInferior(inferior);
|
||||||
runTool->setSymbolFile(bin);
|
runTool->setSymbolFile(bin);
|
||||||
runTool->setStartMode(AttachToRemoteServer);
|
runTool->setStartMode(AttachToRemoteServer);
|
||||||
|
@@ -168,11 +168,7 @@ QString UvscServerProvider::channelString() const
|
|||||||
bool UvscServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessage) const
|
bool UvscServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessage) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(runTool, return false);
|
QTC_ASSERT(runTool, return false);
|
||||||
const RunControl *runControl = runTool->runControl();
|
const FilePath bin = runTool->runControl()->runnable().command.executable();
|
||||||
const auto exeAspect = runControl->aspectData<ExecutableAspect>();
|
|
||||||
QTC_ASSERT(exeAspect, return false);
|
|
||||||
|
|
||||||
const FilePath bin = exeAspect->executable;
|
|
||||||
if (bin.isEmpty()) {
|
if (bin.isEmpty()) {
|
||||||
errorMessage = Tr::tr("Cannot debug: Local executable is not set.");
|
errorMessage = Tr::tr("Cannot debug: Local executable is not set.");
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user