<div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 21, 2020 at 5:06 AM Pavel Labath <<a href="mailto:pavel@labath.sk">pavel@labath.sk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On 20/07/2020 20:54, Jonas Devlieghere via lldb-commits wrote:<br>
> <br>
> Author: Jonas Devlieghere<br>
> Date: 2020-07-20T11:54:11-07:00<br>
> New Revision: f8df2e1a19913e997d8d6dbe573de977406e736e<br>
> <br>
> URL: <a href="https://github.com/llvm/llvm-project/commit/f8df2e1a19913e997d8d6dbe573de977406e736e" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/f8df2e1a19913e997d8d6dbe573de977406e736e</a><br>
> DIFF: <a href="https://github.com/llvm/llvm-project/commit/f8df2e1a19913e997d8d6dbe573de977406e736e.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/f8df2e1a19913e997d8d6dbe573de977406e736e.diff</a><br>
> <br>
> LOG: [lldb/Reproducers] Always record the current working directory<br>
> <br>
> Setting the current working directory in the VFS will fail if the given<br>
> path doesn't exist in the YAML mapping or on disk.<br>
> <br>
> Added: <br>
>     <br>
> <br>
> Modified: <br>
>     lldb/include/lldb/Utility/Reproducer.h<br>
>     lldb/source/API/SBReproducer.cpp<br>
>     lldb/source/Initialization/SystemInitializerCommon.cpp<br>
>     lldb/test/Shell/Reproducer/TestWorkingDir.test<br>
> <br>
> Removed: <br>
>     <br>
> <br>
> <br>
> ################################################################################<br>
> diff  --git a/lldb/include/lldb/Utility/Reproducer.h b/lldb/include/lldb/Utility/Reproducer.h<br>
> index 2714db8d2932..6fcb839684dc 100644<br>
> --- a/lldb/include/lldb/Utility/Reproducer.h<br>
> +++ b/lldb/include/lldb/Utility/Reproducer.h<br>
> @@ -11,6 +11,7 @@<br>
>  <br>
>  #include "lldb/Utility/FileSpec.h"<br>
>  #include "llvm/ADT/DenseMap.h"<br>
> +#include "llvm/ADT/StringRef.h"<br>
>  #include "llvm/Support/Error.h"<br>
>  #include "llvm/Support/FileCollector.h"<br>
>  #include "llvm/Support/YAMLTraits.h"<br>
> @@ -149,6 +150,7 @@ class WorkingDirectoryProvider : public Provider<WorkingDirectoryProvider> {<br>
>    }<br>
>  <br>
>    void Update(llvm::StringRef path) { m_cwd = std::string(path); }<br>
> +  llvm::StringRef GetWorkingDirectory() { return m_cwd; }<br>
>  <br>
>    struct Info {<br>
>      static const char *name;<br>
> <br>
> diff  --git a/lldb/source/API/SBReproducer.cpp b/lldb/source/API/SBReproducer.cpp<br>
> index 0eb3429c4fef..9815bf11263c 100644<br>
> --- a/lldb/source/API/SBReproducer.cpp<br>
> +++ b/lldb/source/API/SBReproducer.cpp<br>
> @@ -234,7 +234,10 @@ const char *SBReproducer::GetPath() {<br>
>  <br>
>  void SBReproducer::SetWorkingDirectory(const char *path) {<br>
>    if (auto *g = lldb_private::repro::Reproducer::Instance().GetGenerator()) {<br>
> -    g->GetOrCreate<WorkingDirectoryProvider>().Update(path);<br>
> +    auto &wp = g->GetOrCreate<repro::WorkingDirectoryProvider>();<br>
> +    wp.Update(path);<br>
> +    auto &fp = g->GetOrCreate<repro::FileProvider>();<br>
> +    fp.RecordInterestingDirectory(wp.GetWorkingDirectory());<br>
<br>
<br>
If I'm not mistaken, this will (recursively) record the entire contents<br>
of the CWD. That could be a _lot_. Are you that's what you wanted?<br></blockquote><div><br></div><div>Most certainly not. Thanks for pointing that out. Fixed with a test case in 9f8d481d6816d620fc0a1f1c510f662c01fdacec.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
pl<br>
</blockquote></div></div></div>