Debugger: Fix passing working directory with LLDB

It's not the one of the lldb process anymore, so set it explicitly.

Change-Id: Ibcc2b63631c4096f860996ad6ccfc12415d8aefd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
hjk
2016-09-26 13:47:19 +02:00
committed by hjk
parent 59b7601c58
commit bf5f96e423
2 changed files with 5 additions and 1 deletions

View File

@@ -652,6 +652,9 @@ class Dumper(DumperBase):
self.remoteChannel_ = args.get('remotechannel', '')
self.platform_ = args.get('platform', '')
self.nativeMixed = int(args.get('nativemixed', 0))
self.workingDirectory_ = args.get('workingdirectory', '')
if self.workingDirectory_ == '':
self.workingDirectory_ = os.getcwd()
self.ignoreStops = 0
self.silentStops = 0
@@ -729,7 +732,7 @@ class Dumper(DumperBase):
self.reportState("enginerunokandinferiorunrunnable")
else:
launchInfo = lldb.SBLaunchInfo(self.processArgs_)
launchInfo.SetWorkingDirectory(os.getcwd())
launchInfo.SetWorkingDirectory(self.workingDirectory_)
environmentList = [key + "=" + value for key,value in os.environ.items()]
if self.dyldImageSuffix:
environmentList.append('DYLD_IMAGE_SUFFIX=' + self.dyldImageSuffix)

View File

@@ -349,6 +349,7 @@ void LldbEngine::setupInferior()
cmd2.arg("dyldimagesuffix", rp.inferior.environment.value("DYLD_IMAGE_SUFFIX"));
cmd2.arg("dyldframeworkpath", rp.inferior.environment.value("DYLD_LIBRARY_PATH"));
cmd2.arg("dyldlibrarypath", rp.inferior.environment.value("DYLD_FRAMEWORK_PATH"));
cmd2.arg("workingdirectory", rp.inferior.workingDirectory);
QJsonArray processArgs;
foreach (const QString &arg, args.toUnixArgs())