Commit 885f8b53 authored by hjk's avatar hjk

Debugger: Short-circuit part of the parameter fixup machinery

... which should not exist to start with, and interferes in some
cases where the user code knows better.

Change-Id: Ie0b0038af3a4056fad8655d06f677fc800c99f8d
Reviewed-by: Christian Kandeler's avatarChristian Kandeler <christian.kandeler@qt.io>
parent 7ab6e345
......@@ -282,7 +282,7 @@ static bool fixupParameters(DebuggerRunParameters &rp, RunControl *runControl, Q
// Extract as much as possible from available RunConfiguration.
const Runnable runnable = runConfig->runnable();
if (runnable.is<StandardRunnable>()) {
if (rp.needFixup && runnable.is<StandardRunnable>()) {
// FIXME: Needed for core dump which stores the executable in inferior, but not in runConfig
// executable.
const QString prevExecutable = rp.inferior.executable;
......@@ -295,7 +295,7 @@ static bool fixupParameters(DebuggerRunParameters &rp, RunControl *runControl, Q
}
// We might get an executable from a local PID.
if (rp.inferior.executable.isEmpty() && rp.attachPID.isValid()) {
if (rp.needFixup && rp.inferior.executable.isEmpty() && rp.attachPID.isValid()) {
foreach (const DeviceProcessItem &p, DeviceProcessList::localProcesses()) {
if (p.pid == rp.attachPID.pid()) {
rp.inferior.executable = p.exe;
......@@ -313,14 +313,16 @@ static bool fixupParameters(DebuggerRunParameters &rp, RunControl *runControl, Q
if (!envBinary.isEmpty())
rp.debugger.executable = QString::fromLocal8Bit(envBinary);
if (auto envAspect = runConfig->extraAspect<EnvironmentAspect>()) {
rp.inferior.environment = envAspect->environment(); // Correct.
rp.stubEnvironment = rp.inferior.environment; // FIXME: Wrong, but contains DYLD_IMAGE_SUFFIX
if (rp.needFixup) {
if (auto envAspect = runConfig->extraAspect<EnvironmentAspect>()) {
rp.inferior.environment = envAspect->environment(); // Correct.
rp.stubEnvironment = rp.inferior.environment; // FIXME: Wrong, but contains DYLD_IMAGE_SUFFIX
// Copy over DYLD_IMAGE_SUFFIX etc
for (auto var : QStringList({"DYLD_IMAGE_SUFFIX", "DYLD_LIBRARY_PATH", "DYLD_FRAMEWORK_PATH"}))
if (rp.inferior.environment.hasKey(var))
rp.debugger.environment.set(var, rp.inferior.environment.value(var));
// Copy over DYLD_IMAGE_SUFFIX etc
for (auto var : QStringList({"DYLD_IMAGE_SUFFIX", "DYLD_LIBRARY_PATH", "DYLD_FRAMEWORK_PATH"}))
if (rp.inferior.environment.hasKey(var))
rp.debugger.environment.set(var, rp.inferior.environment.value(var));
}
}
if (Project *project = runConfig->target()->project()) {
rp.projectSourceDirectory = project->projectDirectory().toString();
......
......@@ -65,6 +65,7 @@ public:
Utils::ProcessHandle attachPID;
QStringList solibSearchPath;
bool useTerminal = false;
bool needFixup = true; // FIXME: Make false the default...
// Used by Qml debugging.
TcpServerConnection qmlServer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment