summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2019-12-11 16:19:08 -0800
committerVedant Kumar <vsk@apple.com>2020-01-10 14:52:51 -0800
commit4c00dbf22d7f0ad005444b412b450ee4b4779b6a (patch)
tree2b53cad68a8464cae20e464f73768291fdee2b7e /lldb/packages/Python/lldbsuite
parentc5adcdc5c88a89241b1150824fc44370c62c7132 (diff)
downloadbcm5719-llvm-4c00dbf22d7f0ad005444b412b450ee4b4779b6a.tar.gz
bcm5719-llvm-4c00dbf22d7f0ad005444b412b450ee4b4779b6a.zip
lldbutil: Forward ASan launch info to test inferiors
This allows an unsanitized test process which loads a sanitized DSO (the motivating example is a Swift runtime dylib) to launch on Darwin. rdar://57290132 Differential Revision: https://reviews.llvm.org/D71379
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbutil.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbutil.py b/lldb/packages/Python/lldbsuite/test/lldbutil.py
index 9deaed5cf50..006362a4479 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -19,6 +19,7 @@ import six
# LLDB modules
import lldb
+from . import lldbtest_config
# ===================================================
@@ -758,6 +759,12 @@ def run_to_breakpoint_make_target(test, exe_name = "a.out", in_cwd = True):
# Create the target
target = test.dbg.CreateTarget(exe)
test.assertTrue(target, "Target: %s is not valid."%(exe_name))
+
+ # Set environment variables for the inferior.
+ if lldbtest_config.inferior_env:
+ test.runCmd('settings set target.env-vars {}'.format(
+ lldbtest_config.inferior_env))
+
return target
def run_to_breakpoint_do_run(test, target, bkpt, launch_info = None,
@@ -765,7 +772,7 @@ def run_to_breakpoint_do_run(test, target, bkpt, launch_info = None,
# Launch the process, and do not stop at the entry point.
if not launch_info:
- launch_info = lldb.SBLaunchInfo(None)
+ launch_info = target.GetLaunchInfo()
launch_info.SetWorkingDirectory(test.get_process_working_directory())
if extra_images and lldb.remote_platform:
OpenPOWER on IntegriCloud