Debugger: Fix passing of solib search path

Amends 92f7da917e.

Also, set it in all branches, not just remote execution, even if this
is the primary and currently actively used way.

Change-Id: I35149bd29b49dab419f83ec0cb424ae9b23827ed
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2024-01-08 16:57:09 +01:00
parent c4e938b407
commit 7942c36ace

View File

@@ -4407,6 +4407,13 @@ void GdbEngine::setupInferior()
if (rp.breakOnMain) if (rp.breakOnMain)
runCommand({"tbreak " + mainFunction()}); runCommand({"tbreak " + mainFunction()});
if (!rp.solibSearchPath.isEmpty()) {
DebuggerCommand cmd("appendSolibSearchPath");
cmd.arg("path", transform(rp.solibSearchPath, &FilePath::path));
cmd.arg("separator", HostOsInfo::pathListSeparator());
runCommand(cmd);
}
if (rp.startMode == AttachToRemoteProcess) { if (rp.startMode == AttachToRemoteProcess) {
handleInferiorPrepared(); handleInferiorPrepared();
@@ -4429,13 +4436,6 @@ void GdbEngine::setupInferior()
// if (!remoteArch.isEmpty()) // if (!remoteArch.isEmpty())
// postCommand("set architecture " + remoteArch); // postCommand("set architecture " + remoteArch);
if (!rp.solibSearchPath.isEmpty()) {
DebuggerCommand cmd("appendSolibSearchPath");
for (const FilePath &filePath : rp.solibSearchPath)
cmd.arg("path", filePath.path());
cmd.arg("separator", HostOsInfo::pathListSeparator());
runCommand(cmd);
}
if (!args.isEmpty()) if (!args.isEmpty())
runCommand({"-exec-arguments " + args}); runCommand({"-exec-arguments " + args});