diff options
-rw-r--r-- | lldb/include/lldb/Utility/Reproducer.h | 3 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectReproducer.cpp | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lldb/include/lldb/Utility/Reproducer.h b/lldb/include/lldb/Utility/Reproducer.h index 1ad7638eec4..7fde9c3e58b 100644 --- a/lldb/include/lldb/Utility/Reproducer.h +++ b/lldb/include/lldb/Utility/Reproducer.h @@ -313,6 +313,9 @@ public: FileSpec GetReproducerPath() const; + bool IsCapturing() { return static_cast<bool>(m_generator); }; + bool IsReplaying() { return static_cast<bool>(m_loader); }; + protected: llvm::Error SetCapture(llvm::Optional<FileSpec> root); llvm::Error SetReplay(llvm::Optional<FileSpec> root); diff --git a/lldb/source/Commands/CommandObjectReproducer.cpp b/lldb/source/Commands/CommandObjectReproducer.cpp index 404702d3640..424595fc0bd 100644 --- a/lldb/source/Commands/CommandObjectReproducer.cpp +++ b/lldb/source/Commands/CommandObjectReproducer.cpp @@ -88,7 +88,7 @@ protected: auto &r = Reproducer::Instance(); if (auto generator = r.GetGenerator()) { generator->Keep(); - } else if (r.GetLoader()) { + } else if (r.IsReplaying()) { // Make this operation a NOP in replay mode. result.SetStatus(eReturnStatusSuccessFinishNoResult); return result.Succeeded(); @@ -132,9 +132,9 @@ protected: } auto &r = Reproducer::Instance(); - if (r.GetGenerator()) { + if (r.IsCapturing()) { result.GetOutputStream() << "Reproducer is in capture mode.\n"; - } else if (r.GetLoader()) { + } else if (r.IsReplaying()) { result.GetOutputStream() << "Reproducer is in replay mode.\n"; } else { result.GetOutputStream() << "Reproducer is off.\n"; |