[Lldb-commits] [lldb] 9f8d481 - [lldb/Reproducers] Don't recursively record everything in the CWD

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 21 09:02:44 PDT 2020


Author: Jonas Devlieghere
Date: 2020-07-21T09:02:38-07:00
New Revision: 9f8d481d6816d620fc0a1f1c510f662c01fdacec

URL: https://github.com/llvm/llvm-project/commit/9f8d481d6816d620fc0a1f1c510f662c01fdacec
DIFF: https://github.com/llvm/llvm-project/commit/9f8d481d6816d620fc0a1f1c510f662c01fdacec.diff

LOG: [lldb/Reproducers] Don't recursively record everything in the CWD

RecordInterestingDirectory was added to collect dSYM bundles and their
content. For the current working directory we only want the directory to
be part of the VFS, not necessarily its contents. This patch renames the
current method to RecordInterestingDirectoryRecursively and adds a new
one that's not recursive.

Added: 
    

Modified: 
    lldb/include/lldb/Utility/Reproducer.h
    lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
    lldb/source/Utility/Reproducer.cpp
    lldb/test/Shell/Reproducer/TestWorkingDir.test

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Utility/Reproducer.h b/lldb/include/lldb/Utility/Reproducer.h
index 6fcb839684dc..b3d470702ee5 100644
--- a/lldb/include/lldb/Utility/Reproducer.h
+++ b/lldb/include/lldb/Utility/Reproducer.h
@@ -101,6 +101,7 @@ class FileProvider : public Provider<FileProvider> {
   }
 
   void RecordInterestingDirectory(const llvm::Twine &dir);
+  void RecordInterestingDirectoryRecursive(const llvm::Twine &dir);
 
   void Keep() override {
     auto mapping = GetRoot().CopyByAppendingPathComponent(Info::file);

diff  --git a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
index e510ee2d0225..336538241b6a 100644
--- a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
+++ b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
@@ -299,7 +299,7 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
           if (repro::Generator *g =
                   repro::Reproducer::Instance().GetGenerator()) {
             repro::FileProvider &fp = g->GetOrCreate<repro::FileProvider>();
-            fp.RecordInterestingDirectory(dsym_root);
+            fp.RecordInterestingDirectoryRecursive(dsym_root);
           }
         }
         return symbol_vendor;

diff  --git a/lldb/source/Utility/Reproducer.cpp b/lldb/source/Utility/Reproducer.cpp
index 46e909ecdba6..3ad1064cd4c4 100644
--- a/lldb/source/Utility/Reproducer.cpp
+++ b/lldb/source/Utility/Reproducer.cpp
@@ -300,6 +300,11 @@ void WorkingDirectoryProvider::Keep() {
 }
 
 void FileProvider::RecordInterestingDirectory(const llvm::Twine &dir) {
+  if (m_collector)
+    m_collector->addFile(dir);
+}
+
+void FileProvider::RecordInterestingDirectoryRecursive(const llvm::Twine &dir) {
   if (m_collector)
     m_collector->addDirectory(dir);
 }

diff  --git a/lldb/test/Shell/Reproducer/TestWorkingDir.test b/lldb/test/Shell/Reproducer/TestWorkingDir.test
index 76df41fbcbbf..92a9ccd7fc74 100644
--- a/lldb/test/Shell/Reproducer/TestWorkingDir.test
+++ b/lldb/test/Shell/Reproducer/TestWorkingDir.test
@@ -20,8 +20,13 @@
 # referenced.
 
 # RUN: rm -rf %t.repro
+# RUN: rm -rf %t
 # RUN: mkdir -p %t/probably_unique
+# RUN: touch %t/probably_unique/dont_include_me
 # RUN: cd %t/probably_unique
 # RUN: %lldb -x -b -o 'reproducer generate' --capture --capture-path %t.repro
 # RUN: cat %t.repro/cwd.txt | FileCheck %s
 # CHECK: probably_unique
+# RUN: cat %t.repro/files.yaml | FileCHeck %s --check-prefix VFS
+# VFS: probably_unique
+# VFS-NOT: dont_include_me


        


More information about the lldb-commits mailing list