[Lldb-commits] [PATCH] D71379: lldbutil: Forward ASan launch info to test inferiors

2020-01-10 Thread Vedant Kumar via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG4c00dbf22d7f: lldbutil: Forward ASan launch info to test 
inferiors (authored by vsk).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71379/new/

https://reviews.llvm.org/D71379

Files:
  lldb/packages/Python/lldbsuite/test/lldbutil.py
  lldb/test/API/lit.cfg.py


Index: lldb/test/API/lit.cfg.py
===
--- lldb/test/API/lit.cfg.py
+++ lldb/test/API/lit.cfg.py
@@ -87,6 +87,12 @@
 if config.llvm_libs_dir:
   dotest_cmd += ['--env', 'LLVM_LIBS_DIR=' + config.llvm_libs_dir]
 
+# Forward ASan-specific environment variables to tests, as a test may load an
+# ASan-ified dylib.
+for env_var in ('ASAN_OPTIONS', 'DYLD_INSERT_LIBRARIES'):
+  if env_var in config.environment:
+dotest_cmd += ['--inferior-env', env_var + '=' + 
config.environment[env_var]]
+
 if config.lldb_build_directory:
   dotest_cmd += ['--build-dir', config.lldb_build_directory]
 
Index: lldb/packages/Python/lldbsuite/test/lldbutil.py
===
--- lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -19,6 +19,7 @@
 
 # LLDB modules
 import lldb
+from . import lldbtest_config
 
 
 # ===
@@ -758,6 +759,12 @@
 # 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 @@
 
 # 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:


Index: lldb/test/API/lit.cfg.py
===
--- lldb/test/API/lit.cfg.py
+++ lldb/test/API/lit.cfg.py
@@ -87,6 +87,12 @@
 if config.llvm_libs_dir:
   dotest_cmd += ['--env', 'LLVM_LIBS_DIR=' + config.llvm_libs_dir]
 
+# Forward ASan-specific environment variables to tests, as a test may load an
+# ASan-ified dylib.
+for env_var in ('ASAN_OPTIONS', 'DYLD_INSERT_LIBRARIES'):
+  if env_var in config.environment:
+dotest_cmd += ['--inferior-env', env_var + '=' + config.environment[env_var]]
+
 if config.lldb_build_directory:
   dotest_cmd += ['--build-dir', config.lldb_build_directory]
 
Index: lldb/packages/Python/lldbsuite/test/lldbutil.py
===
--- lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -19,6 +19,7 @@
 
 # LLDB modules
 import lldb
+from . import lldbtest_config
 
 
 # ===
@@ -758,6 +759,12 @@
 # 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 @@
 
 # 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:
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D71379: lldbutil: Forward ASan launch info to test inferiors

2020-01-06 Thread Davide Italiano via Phabricator via lldb-commits
davide accepted this revision.
davide added a comment.

This looks good to me.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71379/new/

https://reviews.llvm.org/D71379



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D71379: lldbutil: Forward ASan launch info to test inferiors

2020-01-06 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

We already have something like this for the sanitized bot. I think this will 
cause the variable to bet set twice in the launch info twice? If not this LGTM.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71379/new/

https://reviews.llvm.org/D71379



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D71379: lldbutil: Forward ASan launch info to test inferiors

2020-01-06 Thread Vedant Kumar via Phabricator via lldb-commits
vsk added a comment.

Ping.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71379/new/

https://reviews.llvm.org/D71379



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D71379: lldbutil: Forward ASan launch info to test inferiors

2019-12-11 Thread Vedant Kumar via Phabricator via lldb-commits
vsk created this revision.
vsk added reviewers: davide, jingham.
vsk edited the summary of this revision.

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


https://reviews.llvm.org/D71379

Files:
  lldb/packages/Python/lldbsuite/test/lldbutil.py
  lldb/test/API/lit.cfg.py


Index: lldb/test/API/lit.cfg.py
===
--- lldb/test/API/lit.cfg.py
+++ lldb/test/API/lit.cfg.py
@@ -90,6 +90,12 @@
 if config.llvm_libs_dir:
   dotest_cmd += ['--env', 'LLVM_LIBS_DIR=' + config.llvm_libs_dir]
 
+# Forward ASan-specific environment variables to tests, as a test may load an
+# ASan-ified dylib.
+for env_var in ('ASAN_OPTIONS', 'DYLD_INSERT_LIBRARIES'):
+  if env_var in config.environment:
+dotest_cmd += ['--inferior-env', env_var + '=' + 
config.environment[env_var]]
+
 if config.lldb_build_directory:
   dotest_cmd += ['--build-dir', config.lldb_build_directory]
 
Index: lldb/packages/Python/lldbsuite/test/lldbutil.py
===
--- lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -19,6 +19,7 @@
 
 # LLDB modules
 import lldb
+from . import lldbtest_config
 
 
 # ===
@@ -758,6 +759,12 @@
 # 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 @@
 
 # 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:


Index: lldb/test/API/lit.cfg.py
===
--- lldb/test/API/lit.cfg.py
+++ lldb/test/API/lit.cfg.py
@@ -90,6 +90,12 @@
 if config.llvm_libs_dir:
   dotest_cmd += ['--env', 'LLVM_LIBS_DIR=' + config.llvm_libs_dir]
 
+# Forward ASan-specific environment variables to tests, as a test may load an
+# ASan-ified dylib.
+for env_var in ('ASAN_OPTIONS', 'DYLD_INSERT_LIBRARIES'):
+  if env_var in config.environment:
+dotest_cmd += ['--inferior-env', env_var + '=' + config.environment[env_var]]
+
 if config.lldb_build_directory:
   dotest_cmd += ['--build-dir', config.lldb_build_directory]
 
Index: lldb/packages/Python/lldbsuite/test/lldbutil.py
===
--- lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -19,6 +19,7 @@
 
 # LLDB modules
 import lldb
+from . import lldbtest_config
 
 
 # ===
@@ -758,6 +759,12 @@
 # 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 @@
 
 # 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:
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits