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