LLDB: Set environment for debugged process

Task-number: QTCREATORBUG-10030

Change-Id: Ib487cee704ea30f52c52f6f025823637fa4199eb
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Eike Ziller
2013-10-20 21:45:47 +02:00
committed by hjk
parent e7c51ebd05
commit 51a257637e
2 changed files with 4 additions and 0 deletions

View File

@@ -692,6 +692,8 @@ class Dumper(DumperBase):
else: else:
launchInfo = lldb.SBLaunchInfo(self.processArgs_.split(' ')) launchInfo = lldb.SBLaunchInfo(self.processArgs_.split(' '))
launchInfo.SetWorkingDirectory(os.getcwd()) launchInfo.SetWorkingDirectory(os.getcwd())
environmentList = [key + "=" + value for key,value in os.environ.items()]
launchInfo.SetEnvironmentEntries(environmentList, False)
self.process = self.target.Launch(launchInfo, error) self.process = self.target.Launch(launchInfo, error)
self.report('pid="%s"' % self.process.GetProcessID()) self.report('pid="%s"' % self.process.GetProcessID())

View File

@@ -151,6 +151,8 @@ void LldbEngine::setupEngine()
args.append(Core::ICore::resourcePath() + _("/debugger/lldbbridge.py")); args.append(Core::ICore::resourcePath() + _("/debugger/lldbbridge.py"));
args.append(m_lldbCmd); args.append(m_lldbCmd);
showMessage(_("STARTING LLDB ") + args.join(QLatin1String(" "))); showMessage(_("STARTING LLDB ") + args.join(QLatin1String(" ")));
m_lldbProc.setEnvironment(startParameters().environment.toStringList());
m_lldbProc.start(_("python"), args); m_lldbProc.start(_("python"), args);
if (!m_lldbProc.waitForStarted()) { if (!m_lldbProc.waitForStarted()) {