forked from qt-creator/qt-creator
Debugger: Force passing DYLD_.... environment variables to inferior
Apple's LLDB has changed behavior between 330.x and 340.x. Newer versions seem to actively delete the DYLD_IMAGE_SUFFIX, DYLD_LIBRARY_PATH and DYLD_FRAMEWORK_PATH environment variables from the scripting environment. Change-Id: I0b7bbdce0975e969b1dae5770fd9a99328f241be Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -218,6 +218,9 @@ class Dumper(DumperBase):
|
|||||||
self.startMode_ = None
|
self.startMode_ = None
|
||||||
self.processArgs_ = None
|
self.processArgs_ = None
|
||||||
self.attachPid_ = None
|
self.attachPid_ = None
|
||||||
|
self.dyldImageSuffix = None
|
||||||
|
self.dyldLibraryPath = None
|
||||||
|
self.dyldFrameworkPath = None
|
||||||
|
|
||||||
self.charType_ = None
|
self.charType_ = None
|
||||||
self.intType_ = None
|
self.intType_ = None
|
||||||
@@ -658,6 +661,9 @@ class Dumper(DumperBase):
|
|||||||
self.breakOnMain_ = args.get('breakonmain', 0)
|
self.breakOnMain_ = args.get('breakonmain', 0)
|
||||||
self.useTerminal_ = args.get('useterminal', 0)
|
self.useTerminal_ = args.get('useterminal', 0)
|
||||||
self.processArgs_ = args.get('processargs', [])
|
self.processArgs_ = args.get('processargs', [])
|
||||||
|
self.dyldImageSuffix = args.get('dyldimagesuffix', '')
|
||||||
|
self.dyldLibraryPath = args.get('dyldlibrarypath', '')
|
||||||
|
self.dyldFrameworkPath = args.get('dyldframeworkpath', '')
|
||||||
self.processArgs_ = map(lambda x: self.hexdecode(x), self.processArgs_)
|
self.processArgs_ = map(lambda x: self.hexdecode(x), self.processArgs_)
|
||||||
self.attachPid_ = args.get('attachpid', 0)
|
self.attachPid_ = args.get('attachpid', 0)
|
||||||
self.sysRoot_ = args.get('sysroot', '')
|
self.sysRoot_ = args.get('sysroot', '')
|
||||||
@@ -738,6 +744,12 @@ class Dumper(DumperBase):
|
|||||||
launchInfo = lldb.SBLaunchInfo(self.processArgs_)
|
launchInfo = lldb.SBLaunchInfo(self.processArgs_)
|
||||||
launchInfo.SetWorkingDirectory(os.getcwd())
|
launchInfo.SetWorkingDirectory(os.getcwd())
|
||||||
environmentList = [key + "=" + value for key,value in os.environ.items()]
|
environmentList = [key + "=" + value for key,value in os.environ.items()]
|
||||||
|
if self.dyldImageSuffix:
|
||||||
|
environmentList.append('DYLD_IMAGE_SUFFIX=' + self.dyldImageSuffix)
|
||||||
|
if self.dyldLibraryPath:
|
||||||
|
environmentList.append('DYLD_LIBRARY_PATH=' + self.dyldLibraryPath)
|
||||||
|
if self.dyldFrameworkPath:
|
||||||
|
environmentList.append('DYLD_FRAMEWORK_PATH=' + self.dyldFrameworkPath)
|
||||||
launchInfo.SetEnvironmentEntries(environmentList, False)
|
launchInfo.SetEnvironmentEntries(environmentList, False)
|
||||||
if self.breakOnMain_:
|
if self.breakOnMain_:
|
||||||
self.createBreakpointAtMain()
|
self.createBreakpointAtMain()
|
||||||
|
|||||||
@@ -337,6 +337,11 @@ void LldbEngine::setupInferior()
|
|||||||
cmd2.arg("startmode", rp.startMode);
|
cmd2.arg("startmode", rp.startMode);
|
||||||
cmd2.arg("nativemixed", isNativeMixedActive());
|
cmd2.arg("nativemixed", isNativeMixedActive());
|
||||||
|
|
||||||
|
// FIXME: separate Inferior and Debugger environments properly
|
||||||
|
cmd2.arg("dyldimagesuffix", rp.environment.value(_("DYLD_IMAGE_SUFFIX")));
|
||||||
|
cmd2.arg("dyldframeworkpath", rp.environment.value(_("DYLD_LIBRARY_PATH")));
|
||||||
|
cmd2.arg("dyldlibrarypath", rp.environment.value(_("DYLD_FRAMEWORK_PATH")));
|
||||||
|
|
||||||
QJsonArray processArgs;
|
QJsonArray processArgs;
|
||||||
foreach (const QString &arg, args.toUnixArgs())
|
foreach (const QString &arg, args.toUnixArgs())
|
||||||
processArgs.append(QLatin1String(arg.toUtf8().toHex()));
|
processArgs.append(QLatin1String(arg.toUtf8().toHex()));
|
||||||
|
|||||||
Reference in New Issue
Block a user