1 //===-- SBReproducer.cpp ----------------------------------------*- 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 #include "SBReproducerPrivate.h"
10 
11 #include "lldb/API/LLDB.h"
12 #include "lldb/API/SBAddress.h"
13 #include "lldb/API/SBAttachInfo.h"
14 #include "lldb/API/SBBlock.h"
15 #include "lldb/API/SBBreakpoint.h"
16 #include "lldb/API/SBCommandInterpreter.h"
17 #include "lldb/API/SBData.h"
18 #include "lldb/API/SBDebugger.h"
19 #include "lldb/API/SBDeclaration.h"
20 #include "lldb/API/SBError.h"
21 #include "lldb/API/SBFileSpec.h"
22 #include "lldb/API/SBHostOS.h"
23 #include "lldb/API/SBReproducer.h"
24 
25 #include "lldb/Host/FileSystem.h"
26 
27 using namespace lldb;
28 using namespace lldb_private;
29 using namespace lldb_private::repro;
30 
31 SBRegistry::SBRegistry() {}
32 
33 bool SBReproducer::Replay() {
34   repro::Loader *loader = repro::Reproducer::Instance().GetLoader();
35   if (!loader)
36     return false;
37 
38   FileSpec file = loader->GetFile<SBInfo>();
39   if (!file)
40     return false;
41 
42   SBRegistry registry;
43   registry.Replay(file);
44 
45   return true;
46 }
47 
48 char lldb_private::repro::SBProvider::ID = 0;
49 const char *SBInfo::name = "sbapi";
50 const char *SBInfo::file = "sbapi.bin";
51