aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Utility/Reproducer.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-03-12 17:10:28 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-03-12 17:10:28 +0000
commit5650eb5b005fbb987c515c8354eac85130b393a4 (patch)
tree07ca374b2e2d8c83299278a8ab5e70315402bfec /lldb/source/Utility/Reproducer.cpp
parent6c0bbfc0c94b24bfe52745323656e81beb8334e7 (diff)
downloadllvm-5650eb5b005fbb987c515c8354eac85130b393a4.tar.gz
llvm-5650eb5b005fbb987c515c8354eac85130b393a4.tar.bz2
llvm-5650eb5b005fbb987c515c8354eac85130b393a4.zip
[Reproducers] Stop recording instead of deallocating
The command interpreter holds a pointer to a DataRecorder. After generating the reproducer, we deallocated all the DataRecorders, causing the command interpreter to hold a non-null reference to an invalid object. This patch changes the behavior of the command provider to stop the DataRecorders when a reproducer is generated, rather than deallocating them. llvm-svn: 355940
Diffstat (limited to 'lldb/source/Utility/Reproducer.cpp')
-rw-r--r--lldb/source/Utility/Reproducer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lldb/source/Utility/Reproducer.cpp b/lldb/source/Utility/Reproducer.cpp
index 3e2ffcda281c..20d255e0019e 100644
--- a/lldb/source/Utility/Reproducer.cpp
+++ b/lldb/source/Utility/Reproducer.cpp
@@ -247,8 +247,10 @@ DataRecorder *CommandProvider::GetNewDataRecorder() {
void CommandProvider::Keep() {
std::vector<std::string> files;
- for (auto &recorder : m_data_recorders)
+ for (auto &recorder : m_data_recorders) {
+ recorder->Stop();
files.push_back(recorder->GetFilename().GetPath());
+ }
FileSpec file = GetRoot().CopyByAppendingPathComponent(info::file);
std::error_code ec;