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 37 /// The SBReproducer class is special because it bootstraps the capture and 38 /// replay of SB API calls. As a result we cannot rely on any other SB objects 39 /// in the interface or implementation of this class. 40 class LLDB_API SBReproducer { 41 public: 42 static const char *Capture(); 43 static const char *Capture(const char *path); 44 static const char *Replay(const char *path); 45 static const char *Replay(const char *path, bool skip_version_check); 46 static const char *Replay(const char *path, const SBReplayOptions &options); 47 static const char *PassiveReplay(const char *path); 48 static const char *Finalize(const char *path); 49 static const char *GetPath(); 50 static bool SetAutoGenerate(bool b); 51 static bool Generate(); 52 53 /// The working directory is set to the current working directory when the 54 /// reproducers are initialized. This method allows setting a different 55 /// working directory. This is used by the API test suite which temporarily 56 /// changes the directory to where the test lives. This is a NO-OP in every 57 /// mode but capture. 58 static void SetWorkingDirectory(const char *path); 59 }; 60 61 } // namespace lldb 62 63 #endif 64