From: Jonas Devlieghere Date: Tue, 21 Jul 2020 15:59:44 +0000 (-0700) Subject: [lldb/Reproducers] Don't recursively record everything in the CWD X-Git-Tag: llvmorg-13-init~17280 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9f8d481d6816d620fc0a1f1c510f662c01fdacec;p=platform%2Fupstream%2Fllvm.git [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. --- diff --git a/lldb/include/lldb/Utility/Reproducer.h b/lldb/include/lldb/Utility/Reproducer.h index 6fcb839..b3d4707 100644 --- a/lldb/include/lldb/Utility/Reproducer.h +++ b/lldb/include/lldb/Utility/Reproducer.h @@ -101,6 +101,7 @@ public: } 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 e510ee2..3365382 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(); - 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 46e909e..3ad1064 100644 --- a/lldb/source/Utility/Reproducer.cpp +++ b/lldb/source/Utility/Reproducer.cpp @@ -301,6 +301,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 76df41f..92a9ccd 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