[Lldb-commits] [PATCH] D70887: [lldb] Use realpath to avoid issues with symlinks in source paths

António Afonso via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Dec 1 20:54:58 PST 2019


aadsm created this revision.
aadsm added reviewers: clayborg, lanza, wallace.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

I was not able to sucessfully run TestDSYMSourcePathRemapping.py because the source mapping was using /tmp/ but the debugger was checking /private/tmp (which is a symlink to tmp). Maybe the debugger should realpath on it? Not sure but by making sure our tests always use the real path it avoids these kind of issues.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70887

Files:
  lldb/packages/Python/lldbsuite/test/lldbtest.py


Index: lldb/packages/Python/lldbsuite/test/lldbtest.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -656,15 +656,15 @@
 
     def getSourceDir(self):
         """Return the full path to the current test."""
-        return os.path.join(os.environ["LLDB_TEST"], self.mydir)
+        return os.path.realpath(os.path.join(os.environ["LLDB_TEST"], self.mydir))
 
     def getBuildDirBasename(self):
         return self.__class__.__module__ + "." + self.testMethodName
 
     def getBuildDir(self):
         """Return the full path to the current test."""
-        return os.path.join(os.environ["LLDB_BUILD"], self.mydir,
-                            self.getBuildDirBasename())
+        return os.path.realpath(os.path.join(os.environ["LLDB_BUILD"], self.mydir,
+                            self.getBuildDirBasename()))
 
 
     def makeBuildDir(self):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70887.231635.patch
Type: text/x-patch
Size: 981 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191202/b15a7f46/attachment.bin>


More information about the lldb-commits mailing list