forked from qt-creator/qt-creator
Debugger: Transform DebuggerRunParameters::sysRoot
Task-number: QTCREATORBUG-29168 Change-Id: Ib4421ecb0a8ca26473960858f9ca257107d694a4 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -143,7 +143,7 @@ public:
|
||||
/ devicePreferredAbi; // Legacy Ndk structure
|
||||
if (!sysRoot.exists())
|
||||
sysRoot = AndroidConfig::toolchainPathFromNdk(ndkLocation) / "sysroot";
|
||||
setSysRoot(sysRoot);
|
||||
rp.setSysRoot(sysRoot);
|
||||
qCDebug(androidDebugSupportLog).noquote() << "Sysroot: " << sysRoot.toUserOutput();
|
||||
}
|
||||
}
|
||||
|
@@ -422,7 +422,7 @@ void StartApplicationDialog::run(bool attachRemote)
|
||||
debugger->setUseTerminal(newParameters.runInTerminal);
|
||||
rp.setUseExtendedRemote(newParameters.useTargetExtendedRemote);
|
||||
if (!newParameters.sysRoot.isEmpty())
|
||||
debugger->setSysRoot(newParameters.sysRoot);
|
||||
rp.setSysRoot(newParameters.sysRoot);
|
||||
|
||||
bool isLocal = dev->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
|
||||
if (isLocal) // FIXME: Restriction needed?
|
||||
|
@@ -136,7 +136,7 @@ DebuggerRunParameters DebuggerRunParameters::fromRunControl(ProjectExplorer::Run
|
||||
if (auto runAsRootAspect = runControl->aspectData<RunAsRootAspect>())
|
||||
params.runAsRoot = runAsRootAspect->value;
|
||||
|
||||
params.sysRoot = SysRootKitAspect::sysRoot(kit);
|
||||
params.setSysRoot(SysRootKitAspect::sysRoot(kit));
|
||||
params.macroExpander = runControl->macroExpander();
|
||||
params.debugger = DebuggerKitAspect::runnable(kit);
|
||||
params.cppEngineType = DebuggerKitAspect::engineType(kit);
|
||||
@@ -244,9 +244,9 @@ Result DebuggerRunParameters::fixupParameters(ProjectExplorer::RunControl *runCo
|
||||
|
||||
if (settings().autoEnrichParameters()) {
|
||||
if (debugInfoLocation.isEmpty())
|
||||
debugInfoLocation = sysRoot / "/usr/lib/debug";
|
||||
debugInfoLocation = m_sysRoot / "/usr/lib/debug";
|
||||
if (debugSourceLocation.isEmpty()) {
|
||||
const QString base = sysRoot.toUrlishString() + "/usr/src/debug/";
|
||||
const QString base = m_sysRoot.toUrlishString() + "/usr/src/debug/";
|
||||
debugSourceLocation.append(base + "qt5base/src/corelib");
|
||||
debugSourceLocation.append(base + "qt5base/src/gui");
|
||||
debugSourceLocation.append(base + "qt5base/src/network");
|
||||
@@ -330,7 +330,7 @@ void DebuggerRunParameters::setStartMode(DebuggerStartMode startMode)
|
||||
void DebuggerRunParameters::addSolibSearchDir(const QString &str)
|
||||
{
|
||||
QString path = str;
|
||||
path.replace("%{sysroot}", sysRoot.toUrlishString());
|
||||
path.replace("%{sysroot}", m_sysRoot.toUrlishString());
|
||||
m_solibSearchPath.append(FilePath::fromString(path));
|
||||
}
|
||||
|
||||
@@ -2927,7 +2927,7 @@ QString DebuggerEngine::formatStartParameters() const
|
||||
str << "Remote: " << sp.remoteChannel() << '\n';
|
||||
if (!sp.qmlServer().host().isEmpty())
|
||||
str << "QML server: " << sp.qmlServer().host() << ':' << sp.qmlServer().port() << '\n';
|
||||
str << "Sysroot: " << sp.sysRoot << '\n';
|
||||
str << "Sysroot: " << sp.sysRoot() << '\n';
|
||||
str << "Debug Source Location: " << sp.debugSourceLocation.join(':') << '\n';
|
||||
return rc;
|
||||
}
|
||||
|
@@ -161,7 +161,9 @@ public:
|
||||
void setContinueAfterAttach(bool on) { m_continueAfterAttach = on; }
|
||||
bool continueAfterAttach() const { return m_continueAfterAttach; }
|
||||
|
||||
Utils::FilePath sysRoot;
|
||||
void setSysRoot(const Utils::FilePath &sysRoot) { m_sysRoot = sysRoot; }
|
||||
Utils::FilePath sysRoot() const { return m_sysRoot; }
|
||||
|
||||
// iOS 17+
|
||||
QString deviceUuid;
|
||||
|
||||
@@ -265,6 +267,7 @@ private:
|
||||
|
||||
QString m_deviceSymbolsRoot;
|
||||
bool m_continueAfterAttach = false;
|
||||
Utils::FilePath m_sysRoot;
|
||||
};
|
||||
|
||||
namespace Internal {
|
||||
|
@@ -1396,7 +1396,7 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
|
||||
DebuggerRunParameters &rp = debugger->runParameters();
|
||||
rp.setInferiorExecutable(executable);
|
||||
if (!sysRoot.isEmpty())
|
||||
debugger->setSysRoot(FilePath::fromUserInput(sysRoot));
|
||||
rp.setSysRoot(FilePath::fromUserInput(sysRoot));
|
||||
if (pid) {
|
||||
rp.setStartMode(AttachToLocalProcess);
|
||||
rp.setCloseMode(DetachAtClose);
|
||||
|
@@ -103,11 +103,6 @@ public:
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
void DebuggerRunTool::setSysRoot(const Utils::FilePath &sysRoot)
|
||||
{
|
||||
m_runParameters.sysRoot = sysRoot;
|
||||
}
|
||||
|
||||
void DebuggerRunTool::setBreakOnMain(bool on)
|
||||
{
|
||||
m_runParameters.breakOnMain = on;
|
||||
|
@@ -33,8 +33,6 @@ public:
|
||||
void setStartMessage(const QString &msg);
|
||||
void setCrashParameter(const QString &event);
|
||||
|
||||
void setSysRoot(const Utils::FilePath &sysRoot);
|
||||
|
||||
void setBreakOnMain(bool on);
|
||||
void setUseTerminal(bool on);
|
||||
void setUseDebugServer(Utils::ProcessHandle attachPid, bool essential, bool useMulti);
|
||||
|
@@ -1608,7 +1608,7 @@ FilePath GdbEngine::cleanupFullName(const QString &fileName)
|
||||
if (cleanFilePath.isReadableFile())
|
||||
return cleanFilePath;
|
||||
|
||||
const FilePath sysroot = runParameters().sysRoot;
|
||||
const FilePath sysroot = runParameters().sysRoot();
|
||||
if (!sysroot.isEmpty() && fileName.startsWith('/')) {
|
||||
cleanFilePath = sysroot.pathAppended(fileName.mid(1));
|
||||
if (cleanFilePath.isReadableFile())
|
||||
@@ -3971,11 +3971,11 @@ void GdbEngine::handleGdbStarted()
|
||||
showMessage("# directory does not exist: " + src, LogInput);
|
||||
}
|
||||
|
||||
if (!rp.sysRoot.isEmpty()) {
|
||||
runCommand({"set sysroot " + rp.sysRoot.path()});
|
||||
if (!rp.sysRoot().isEmpty()) {
|
||||
runCommand({"set sysroot " + rp.sysRoot().path()});
|
||||
// sysroot is not enough to correctly locate the sources, so explicitly
|
||||
// relocate the most likely place for the debug source
|
||||
runCommand({"set substitute-path /usr/src " + rp.sysRoot.path() + "/usr/src"});
|
||||
runCommand({"set substitute-path /usr/src " + rp.sysRoot().path() + "/usr/src"});
|
||||
}
|
||||
|
||||
//QByteArray ba = QFileInfo(sp.dumperLibrary).path().toLocal8Bit();
|
||||
|
@@ -308,7 +308,7 @@ void LldbEngine::handleLldbStarted()
|
||||
&& (rp.startMode() == AttachToRemoteProcess || rp.startMode() == AttachToLocalProcess
|
||||
|| rp.startMode() == AttachToRemoteServer || rp.startMode() == AttachToIosDevice));
|
||||
cmd2.arg("attachpid", rp.attachPid().pid());
|
||||
cmd2.arg("sysroot", rp.deviceSymbolsRoot().isEmpty() ? rp.sysRoot.toUrlishString()
|
||||
cmd2.arg("sysroot", rp.deviceSymbolsRoot().isEmpty() ? rp.sysRoot().toUrlishString()
|
||||
: rp.deviceSymbolsRoot());
|
||||
cmd2.arg("remotechannel", ((rp.startMode() == AttachToRemoteProcess
|
||||
|| rp.startMode() == AttachToRemoteServer)
|
||||
|
@@ -358,7 +358,7 @@ void runAttachToCoreDialog()
|
||||
debugger->setOverrideStartScript(dlg.overrideStartScript());
|
||||
const FilePath sysRoot = dlg.sysRoot();
|
||||
if (!sysRoot.isEmpty())
|
||||
debugger->setSysRoot(sysRoot);
|
||||
rp.setSysRoot(sysRoot);
|
||||
|
||||
runControl->start();
|
||||
}
|
||||
|
@@ -2452,7 +2452,7 @@ FilePath QmlEngine::toFileInProject(const QUrl &fileUrl)
|
||||
d->fileFinder.setProjectDirectory(rp.projectSourceDirectory);
|
||||
d->fileFinder.setProjectFiles(rp.projectSourceFiles);
|
||||
d->fileFinder.setAdditionalSearchDirectories(rp.additionalSearchDirectories());
|
||||
d->fileFinder.setSysroot(rp.sysRoot);
|
||||
d->fileFinder.setSysroot(rp.sysRoot());
|
||||
|
||||
return d->fileFinder.findFile(fileUrl).constFirst();
|
||||
}
|
||||
|
@@ -156,7 +156,7 @@ void showAttachToProcessDialog()
|
||||
rp.setDisplayName(Tr::tr("Remote QNX process %1").arg(pid));
|
||||
rp.setSolibSearchPath(FileUtils::toFilePathList(searchPaths(kit)));
|
||||
if (auto qtVersion = dynamic_cast<QnxQtVersion *>(QtSupport::QtKitAspect::qtVersion(kit)))
|
||||
debugger->setSysRoot(qtVersion->qnxTarget());
|
||||
rp.setSysRoot(qtVersion->qnxTarget());
|
||||
rp.setUseContinueInsteadOfRun(true);
|
||||
|
||||
runControl->start();
|
||||
@@ -209,7 +209,7 @@ public:
|
||||
rp.setUseCtrlCStub(true);
|
||||
rp.setSolibSearchPath(FileUtils::toFilePathList(searchPaths(k)));
|
||||
if (auto qtVersion = dynamic_cast<QnxQtVersion *>(QtSupport::QtKitAspect::qtVersion(k))) {
|
||||
debugger->setSysRoot(qtVersion->qnxTarget());
|
||||
rp.setSysRoot(qtVersion->qnxTarget());
|
||||
debugger->modifyDebuggerEnvironment(qtVersion->environment());
|
||||
}
|
||||
|
||||
|
@@ -174,9 +174,9 @@ private:
|
||||
|
||||
auto sysroot = SysRootKitAspect().sysRoot(runControl()->kit());
|
||||
if (sysroot.isEmpty())
|
||||
setSysRoot("/");
|
||||
rp.setSysRoot("/");
|
||||
else
|
||||
setSysRoot(sysroot);
|
||||
rp.setSysRoot(sysroot);
|
||||
}
|
||||
|
||||
DebuggerRunTool::start();
|
||||
|
Reference in New Issue
Block a user