mgorny created this revision.
mgorny added reviewers: labath, emaste, krytarowski.
Herald added a subscriber: arichardson.
mgorny requested review of this revision.

Use realpath() when spawning the executable create_after_attach
to workaround a FreeBSD plugin (and possibly others) problem.
If the executable is started via a path containing a symlink, it is
added to the module list twice -- via the real and apparent path.
This in turn cases the requested breakpoint to resolve twice.

Since the problem is non-trivial to fix and the purpose of this test
is not to verify that image list does not contain duplicates, let's
apply a trivial workaround to make it pass.


https://reviews.llvm.org/D97230

Files:
  
lldb/test/API/functionalities/thread/create_after_attach/TestCreateAfterAttach.py


Index: 
lldb/test/API/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
===================================================================
--- 
lldb/test/API/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
+++ 
lldb/test/API/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
@@ -25,7 +25,6 @@
     # Occasionally hangs on Windows, may be same as other issues.
     @skipIfWindows
     @skipIfiOSSimulator
-    @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr48376")
     @expectedFailureNetBSD
     def test_create_after_attach(self):
         """Test thread creation after process attach."""
@@ -33,7 +32,8 @@
         exe = self.getBuildArtifact("a.out")
 
         # Spawn a new process
-        popen = self.spawnSubprocess(exe)
+        # use realpath to workaround llvm.org/pr48376
+        popen = self.spawnSubprocess(os.path.realpath(exe))
         pid = popen.pid
 
         # Attach to the spawned process


Index: lldb/test/API/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
===================================================================
--- lldb/test/API/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
+++ lldb/test/API/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
@@ -25,7 +25,6 @@
     # Occasionally hangs on Windows, may be same as other issues.
     @skipIfWindows
     @skipIfiOSSimulator
-    @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr48376")
     @expectedFailureNetBSD
     def test_create_after_attach(self):
         """Test thread creation after process attach."""
@@ -33,7 +32,8 @@
         exe = self.getBuildArtifact("a.out")
 
         # Spawn a new process
-        popen = self.spawnSubprocess(exe)
+        # use realpath to workaround llvm.org/pr48376
+        popen = self.spawnSubprocess(os.path.realpath(exe))
         pid = popen.pid
 
         # Attach to the spawned process
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to