Commit a6d099a1 authored by Friedemann Kleint's avatar Friedemann Kleint

Debugger: Fix LD_PRELOAD on Mac.

Reviewed-by: default avatarhjk <qtc-committer@nokia.com>
parent c8e7df16
......@@ -57,6 +57,12 @@ const char * const DEBUGGER_SETTINGS_CATEGORY = QT_TRANSLATE_NOOP("Debugger", "D
namespace Internal {
enum { debug = 0 };
#ifdef Q_OS_MAC
const char * const LD_PRELOAD_ENV_VAR = "DYLD_INSERT_LIBRARIES";
#else
const char * const LD_PRELOAD_ENV_VAR = "LD_PRELOAD";
#endif
}
} // namespace Constants
......
......@@ -4328,7 +4328,10 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &gdb, const QStr
}
if (m_gdbAdapter->dumperHandling() == AbstractGdbAdapter::DumperLoadedByGdbPreload
&& checkDebuggingHelpers()) {
const QString cmd = QLatin1String("set environment LD_PRELOAD ") + manager()->qtDumperLibraryName();
QString cmd = _("set environment ");
cmd += _(Debugger::Constants::Internal::LD_PRELOAD_ENV_VAR);
cmd += _c(' ');
cmd += manager()->qtDumperLibraryName();
postCommand(cmd);
m_debuggingHelperState = DebuggingHelperLoadTried;
}
......
......@@ -95,7 +95,10 @@ void TermGdbAdapter::startAdapter()
QStringList environment = startParameters().environment;
if (dumperHandling() == DumperLoadedByGdbPreload
&& m_engine->checkDebuggingHelpers()) {
environment.push_back(QLatin1String("LD_PRELOAD=") + m_engine->qtDumperLibraryName());
QString var = QLatin1String(Debugger::Constants::Internal::LD_PRELOAD_ENV_VAR);
var += QLatin1Char('=');
var += m_engine->qtDumperLibraryName();
environment.push_back(var);
m_engine->setDebuggingHelperState(DebuggingHelperLoadTried);
}
m_stubProc.setEnvironment(environment);
......
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