1 //===-- SBReproducer.h ------------------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLDB_API_SBREPRODUCER_H 10 #define LLDB_API_SBREPRODUCER_H 11 12 #include "lldb/API/SBDefines.h" 13 14 namespace lldb_private { 15 namespace repro { 16 struct ReplayOptions; 17 } 18 } // namespace lldb_private 19 20 namespace lldb { 21 22 class LLDB_API SBReplayOptions { 23 public: 24 SBReplayOptions(); 25 SBReplayOptions(const SBReplayOptions &rhs); 26 ~SBReplayOptions(); 27 28 SBReplayOptions &operator=(const SBReplayOptions &rhs); 29 30 void SetVerify(bool verify); 31 bool GetVerify() const; 32 33 void SetCheckVersion(bool check); 34 bool GetCheckVersion() const; 35 36 private: 37 std::unique_ptr<lldb_private::repro::ReplayOptions> m_opaque_up; 38 }; 39 40 /// The SBReproducer class is special because it bootstraps the capture and 41 /// replay of SB API calls. As a result we cannot rely on any other SB objects 42 /// in the interface or implementation of this class. 43 class LLDB_API SBReproducer { 44 public: 45 static const char *Capture(); 46 static const char *Capture(const char *path); 47 static const char *Replay(const char *path); 48 static const char *Replay(const char *path, bool skip_version_check); 49 static const char *Replay(const char *path, const SBReplayOptions &options); 50 static const char *PassiveReplay(const char *path); 51 static const char *Finalize(const char *path); 52 static const char *GetPath(); 53 static bool SetAutoGenerate(bool b); 54 static bool Generate(); 55 56 /// The working directory is set to the current working directory when the 57 /// reproducers are initialized. This method allows setting a different 58 /// working directory. This is used by the API test suite which temporarily 59 /// changes the directory to where the test lives. This is a NO-OP in every 60 /// mode but capture. 61 static void SetWorkingDirectory(const char *path); 62 }; 63 64 } // namespace lldb 65 66 #endif 67