[lldb] Move copying of files into reproducer out of process
authorJonas Devlieghere <jonas@devlieghere.com>
Fri, 23 Oct 2020 19:31:33 +0000 (12:31 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Fri, 23 Oct 2020 19:33:54 +0000 (12:33 -0700)
commit73811d32c72d0760c8c2066e4675dd6f1a7bbef7
tree26581014ae9ee365836f442b65be36665cdf6ec9
parentcb9f6c4c8cbaa327b4836cf0fa61015f760f4002
[lldb] Move copying of files into reproducer out of process

For performance reasons the reproducers don't copy the files captured by
the file collector eagerly, but wait until the reproducer needs to be
generated.

This is a problematic when LLDB crashes and we have to do all this
signal-unsafe work in the signal handler. This patch uses a similar
trick to clang, which has the driver invoke a new cc1 instance to do all
this work out-of-process.

This patch moves the writing of the mapping file as well as copying over
the reproducers into a separate process spawned when lldb crashes.

Differential revision: https://reviews.llvm.org/D89600
14 files changed:
lldb/include/lldb/API/SBReproducer.h
lldb/include/lldb/Host/FileSystem.h
lldb/include/lldb/Utility/Reproducer.h
lldb/include/lldb/Utility/ReproducerProvider.h
lldb/source/API/SBReproducer.cpp
lldb/source/Commands/CommandObjectReproducer.cpp
lldb/source/Host/common/FileSystem.cpp
lldb/source/Plugins/ExpressionParser/Clang/ModuleDependencyCollector.h
lldb/source/Utility/Reproducer.cpp
lldb/source/Utility/ReproducerProvider.cpp
lldb/test/Shell/Reproducer/TestCaptureEnvOverride.test
lldb/test/Shell/Reproducer/TestFinalize.test [new file with mode: 0644]
lldb/tools/driver/Driver.cpp
lldb/tools/driver/Options.td