[Lldb-commits] [lldb] 72ae700 - [lldb/test] Fix lldbutil.run_to_***_breakpoint for shared libraries

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 7 07:07:44 PDT 2020


Author: Pavel Labath
Date: 2020-07-07T16:07:35+02:00
New Revision: 72ae70032ca3fa3e3bd9a3524bf245d5978c0467

URL: https://github.com/llvm/llvm-project/commit/72ae70032ca3fa3e3bd9a3524bf245d5978c0467
DIFF: https://github.com/llvm/llvm-project/commit/72ae70032ca3fa3e3bd9a3524bf245d5978c0467.diff

LOG: [lldb/test] Fix lldbutil.run_to_***_breakpoint for shared libraries

Even non-remote targets may need to set the launch environment
((DY)LD_LIBRARY_PATH, specifically) to run successfully.

Also, add an assertion to better detect the case when launching a target
fails and the breakpoint is never hit.

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/lldbutil.py

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/lldbutil.py b/lldb/packages/Python/lldbsuite/test/lldbutil.py
index ef0df90c416e..25fcd5f29ee2 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -775,7 +775,7 @@ def run_to_breakpoint_do_run(test, target, bkpt, launch_info = None,
         launch_info = target.GetLaunchInfo()
         launch_info.SetWorkingDirectory(test.get_process_working_directory())
 
-    if extra_images and lldb.remote_platform:
+    if extra_images:
         environ = test.registerSharedLibrariesWithTarget(target, extra_images)
         launch_info.SetEnvironmentEntries(environ, True)
 
@@ -788,6 +788,8 @@ def run_to_breakpoint_do_run(test, target, bkpt, launch_info = None,
     test.assertFalse(error.Fail(),
                      "Process launch failed: %s" % (error.GetCString()))
 
+    test.assertEqual(process.GetState(), lldb.eStateStopped)
+
     # Frame #0 should be at our breakpoint.
     threads = get_threads_stopped_at_breakpoint(
                 process, bkpt)


        


More information about the lldb-commits mailing list