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 { 15 16 #ifndef SWIG 17 class LLDB_API SBReplayOptions { 18 public: 19 SBReplayOptions(); 20 SBReplayOptions(const SBReplayOptions &rhs); 21 ~SBReplayOptions(); 22 23 SBReplayOptions &operator=(const SBReplayOptions &rhs); 24 25 void SetVerify(bool verify); 26 bool GetVerify() const; 27 28 void SetCheckVersion(bool check); 29 bool GetCheckVersion() const; 30 }; 31 #endif 32 33 /// The SBReproducer class is special because it bootstraps the capture and 34 /// replay of SB API calls. As a result we cannot rely on any other SB objects 35 /// in the interface or implementation of this class. 36 class LLDB_API SBReproducer { 37 public: 38 #ifndef SWIG 39 static const char *Capture(); 40 #endif 41 static const char *Capture(const char *path); 42 #ifndef SWIG 43 static const char *Replay(const char *path); 44 static const char *Replay(const char *path, bool skip_version_check); 45 static const char *Replay(const char *path, const SBReplayOptions &options); 46 #endif 47 static const char *PassiveReplay(const char *path); 48 #ifndef SWIG 49 static const char *Finalize(const char *path); 50 static const char *GetPath(); 51 #endif 52 static bool SetAutoGenerate(bool b); 53 #ifndef SWIG 54 static bool Generate(); 55 #endif 56 57 /// The working directory is set to the current working directory when the 58 /// reproducers are initialized. This method allows setting a different 59 /// working directory. This is used by the API test suite which temporarily 60 /// changes the directory to where the test lives. This is a NO-OP in every 61 /// mode but capture. 62 static void SetWorkingDirectory(const char *path); 63 }; 64 65 } // namespace lldb 66 67 #endif 68