aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2017-08-14 17:18:31 +0200
committerhjk <hjk@qt.io>2017-08-14 16:03:25 +0000
commit885f8b53858b5c6158a0c6f2208c24cc042b9f38 (patch)
treed7a3dd74f066ddcafdc375ad25074f58e92a6cb3
parent7ab6e345fe42608dcf26d5aac5a91dc31720baa0 (diff)
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 <christian.kandeler@qt.io>
-rw-r--r--src/plugins/debugger/debuggerruncontrol.cpp20
-rw-r--r--src/plugins/debugger/debuggerstartparameters.h1
2 files changed, 12 insertions, 9 deletions
diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp
index c60d4324822..2687d71be22 100644
--- a/src/plugins/debugger/debuggerruncontrol.cpp
+++ b/src/plugins/debugger/debuggerruncontrol.cpp
@@ -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();
diff --git a/src/plugins/debugger/debuggerstartparameters.h b/src/plugins/debugger/debuggerstartparameters.h
index 92d379d6f21..db055341ce2 100644
--- a/src/plugins/debugger/debuggerstartparameters.h
+++ b/src/plugins/debugger/debuggerstartparameters.h
@@ -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;