LLDB  mainline
ReproducerProvider.h
Go to the documentation of this file.
1 //===-- Reproducer.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_UTILITY_REPRODUCER_PROVIDER_H
10 #define LLDB_UTILITY_REPRODUCER_PROVIDER_H
11 
12 #include "lldb/Utility/FileSpec.h"
15 #include "lldb/Utility/UUID.h"
16 #include "llvm/ADT/StringRef.h"
17 #include "llvm/Support/Error.h"
18 #include "llvm/Support/FileCollector.h"
19 #include "llvm/Support/YAMLTraits.h"
20 
21 #include <string>
22 #include <utility>
23 #include <vector>
24 
25 namespace lldb_private {
26 namespace repro {
27 
28 /// The recorder is a small object handed out by a provider to record data. It
29 /// is commonly used in combination with a MultiProvider which is meant to
30 /// record information for multiple instances of the same source of data.
32 protected:
33  AbstractRecorder(const FileSpec &filename, std::error_code &ec)
34  : m_filename(filename.GetFilename().GetStringRef()),
35  m_os(filename.GetPath(), ec, llvm::sys::fs::OF_TextWithCRLF),
36  m_record(true) {}
37 
38 public:
39  const FileSpec &GetFilename() { return m_filename; }
40 
41  void Stop() {
42  assert(m_record);
43  m_record = false;
44  }
45 
46 private:
48 
49 protected:
50  llvm::raw_fd_ostream m_os;
51  bool m_record;
52 };
53 
54 /// Recorder that records its data as text to a file.
56 public:
57  DataRecorder(const FileSpec &filename, std::error_code &ec)
58  : AbstractRecorder(filename, ec) {}
59 
60  static llvm::Expected<std::unique_ptr<DataRecorder>>
61  Create(const FileSpec &filename);
62 
63  template <typename T> void Record(const T &t, bool newline = false) {
64  if (!m_record)
65  return;
66  m_os << t;
67  if (newline)
68  m_os << '\n';
69  m_os.flush();
70  }
71 };
72 
73 /// Recorder that records its data as YAML to a file.
75 public:
76  YamlRecorder(const FileSpec &filename, std::error_code &ec)
77  : AbstractRecorder(filename, ec) {}
78 
79  static llvm::Expected<std::unique_ptr<YamlRecorder>>
80  Create(const FileSpec &filename);
81 
82  template <typename T> void Record(const T &t) {
83  if (!m_record)
84  return;
85  llvm::yaml::Output yout(m_os);
86  // The YAML traits are defined as non-const because they are used for
87  // serialization and deserialization. The cast is safe because
88  // serialization doesn't modify the object.
89  yout << const_cast<T &>(t);
90  m_os.flush();
91  }
92 };
93 
94 class FileProvider : public Provider<FileProvider> {
95 public:
96  struct Info {
97  static const char *name;
98  static const char *file;
99  };
100 
101  FileProvider(const FileSpec &directory) : Provider(directory) {
102  m_collector = std::make_shared<llvm::FileCollector>(
103  directory.CopyByAppendingPathComponent("root").GetPath(),
104  directory.GetPath());
105  }
106 
107  std::shared_ptr<llvm::FileCollector> GetFileCollector() {
108  return m_collector;
109  }
110 
111  void Keep() override;
112 
113  void RecordInterestingDirectory(const llvm::Twine &dir);
114  void RecordInterestingDirectoryRecursive(const llvm::Twine &dir);
115 
116  static char ID;
117 
118 private:
119  std::shared_ptr<llvm::FileCollector> m_collector;
120 };
121 
122 /// Provider for the LLDB version number.
123 ///
124 /// When the reproducer is kept, it writes the lldb version to a file named
125 /// version.txt in the reproducer root.
126 class VersionProvider : public Provider<VersionProvider> {
127 public:
128  VersionProvider(const FileSpec &directory) : Provider(directory) {}
129  struct Info {
130  static const char *name;
131  static const char *file;
132  };
133  void SetVersion(std::string version) {
134  assert(m_version.empty());
135  m_version = std::move(version);
136  }
137  void Keep() override;
139  static char ID;
140 };
141 
142 /// Abstract provider to storing directory paths.
143 template <typename T> class DirectoryProvider : public repro::Provider<T> {
144 public:
145  DirectoryProvider(const FileSpec &root) : Provider<T>(root) {}
146  void SetDirectory(std::string directory) {
147  m_directory = std::move(directory);
148  }
149  llvm::StringRef GetDirectory() { return m_directory; }
150 
151  void Keep() override {
152  FileSpec file = this->GetRoot().CopyByAppendingPathComponent(T::Info::file);
153  std::error_code ec;
154  llvm::raw_fd_ostream os(file.GetPath(), ec, llvm::sys::fs::OF_TextWithCRLF);
155  if (ec)
156  return;
157  os << m_directory << "\n";
158  }
159 
160 protected:
162 };
163 
164 /// Provider for the current working directory.
165 ///
166 /// When the reproducer is kept, it writes lldb's current working directory to
167 /// a file named cwd.txt in the reproducer root.
169  : public DirectoryProvider<WorkingDirectoryProvider> {
170 public:
172  : DirectoryProvider(directory) {
173  llvm::SmallString<128> cwd;
174  if (std::error_code EC = llvm::sys::fs::current_path(cwd))
175  return;
177  }
178  struct Info {
179  static const char *name;
180  static const char *file;
181  };
182  static char ID;
183 };
184 
185 /// Provider for the home directory.
186 ///
187 /// When the reproducer is kept, it writes the user's home directory to a file
188 /// a file named home.txt in the reproducer root.
189 class HomeDirectoryProvider : public DirectoryProvider<HomeDirectoryProvider> {
190 public:
191  HomeDirectoryProvider(const FileSpec &directory)
192  : DirectoryProvider(directory) {
193  llvm::SmallString<128> home_dir;
194  llvm::sys::path::home_directory(home_dir);
195  SetDirectory(std::string(home_dir));
196  }
197  struct Info {
198  static const char *name;
199  static const char *file;
200  };
201  static char ID;
202 };
203 
204 /// Provider for mapping UUIDs to symbol and executable files.
205 class SymbolFileProvider : public Provider<SymbolFileProvider> {
206 public:
207  SymbolFileProvider(const FileSpec &directory) : Provider(directory) {}
208 
209  void AddSymbolFile(const UUID *uuid, const FileSpec &module_path,
210  const FileSpec &symbol_path);
211  void Keep() override;
212 
213  struct Entry {
214  Entry() = default;
215  Entry(std::string uuid) : uuid(std::move(uuid)) {}
217  : uuid(std::move(uuid)), module_path(std::move(module_path)),
218  symbol_path(std::move(symbol_path)) {}
219 
220  bool operator==(const Entry &rhs) const { return uuid == rhs.uuid; }
221  bool operator<(const Entry &rhs) const { return uuid < rhs.uuid; }
222 
226  };
227 
228  struct Info {
229  static const char *name;
230  static const char *file;
231  };
232  static char ID;
233 
234 private:
235  std::vector<Entry> m_symbol_files;
236 };
237 
238 /// The MultiProvider is a provider that hands out recorder which can be used
239 /// to capture data for different instances of the same object. The recorders
240 /// can be passed around or stored as an instance member.
241 ///
242 /// The Info::file for the MultiProvider contains an index of files for every
243 /// recorder. Use the MultiLoader to read the index and get the individual
244 /// files.
245 template <typename T, typename V>
246 class MultiProvider : public repro::Provider<V> {
247 public:
248  MultiProvider(const FileSpec &directory) : Provider<V>(directory) {}
249 
251  std::size_t i = m_recorders.size() + 1;
252  std::string filename = (llvm::Twine(V::Info::name) + llvm::Twine("-") +
253  llvm::Twine(i) + llvm::Twine(".yaml"))
254  .str();
255  auto recorder_or_error =
256  T::Create(this->GetRoot().CopyByAppendingPathComponent(filename));
257  if (!recorder_or_error) {
258  llvm::consumeError(recorder_or_error.takeError());
259  return nullptr;
260  }
261 
262  m_recorders.push_back(std::move(*recorder_or_error));
263  return m_recorders.back().get();
264  }
265 
266  void Keep() override {
267  std::vector<std::string> files;
268  for (auto &recorder : m_recorders) {
269  recorder->Stop();
270  files.push_back(recorder->GetFilename().GetPath());
271  }
272 
273  FileSpec file = this->GetRoot().CopyByAppendingPathComponent(V::Info::file);
274  std::error_code ec;
275  llvm::raw_fd_ostream os(file.GetPath(), ec, llvm::sys::fs::OF_TextWithCRLF);
276  if (ec)
277  return;
278  llvm::yaml::Output yout(os);
279  yout << files;
280  }
281 
282  void Discard() override { m_recorders.clear(); }
283 
284 private:
285  std::vector<std::unique_ptr<T>> m_recorders;
286 };
287 
288 class CommandProvider : public MultiProvider<DataRecorder, CommandProvider> {
289 public:
290  struct Info {
291  static const char *name;
292  static const char *file;
293  };
294 
295  CommandProvider(const FileSpec &directory)
296  : MultiProvider<DataRecorder, CommandProvider>(directory) {}
297 
298  static char ID;
299 };
300 
302 public:
303  ProcessInfoRecorder(const FileSpec &filename, std::error_code &ec)
304  : AbstractRecorder(filename, ec) {}
305 
306  static llvm::Expected<std::unique_ptr<ProcessInfoRecorder>>
307  Create(const FileSpec &filename);
308 
309  void Record(const ProcessInstanceInfoList &process_infos);
310 };
311 
312 class ProcessInfoProvider : public repro::Provider<ProcessInfoProvider> {
313 public:
314  struct Info {
315  static const char *name;
316  static const char *file;
317  };
318 
319  ProcessInfoProvider(const FileSpec &directory) : Provider(directory) {}
320 
322 
323  void Keep() override;
324  void Discard() override;
325 
326  static char ID;
327 
328 private:
329  std::unique_ptr<llvm::raw_fd_ostream> m_stream_up;
330  std::vector<std::unique_ptr<ProcessInfoRecorder>> m_process_info_recorders;
331 };
332 
333 /// Loader for data captured with the MultiProvider. It will read the index and
334 /// return the path to the files in the index.
335 template <typename T> class MultiLoader {
336 public:
337  MultiLoader(std::vector<std::string> files) : m_files(std::move(files)) {}
338 
339  static std::unique_ptr<MultiLoader> Create(Loader *loader) {
340  if (!loader)
341  return {};
342 
343  FileSpec file = loader->GetFile<typename T::Info>();
344  if (!file)
345  return {};
346 
347  auto error_or_file = llvm::MemoryBuffer::getFile(file.GetPath());
348  if (auto err = error_or_file.getError())
349  return {};
350 
351  std::vector<std::string> files;
352  llvm::yaml::Input yin((*error_or_file)->getBuffer());
353  yin >> files;
354 
355  if (auto err = yin.error())
356  return {};
357 
358  for (auto &file : files) {
359  FileSpec absolute_path =
360  loader->GetRoot().CopyByAppendingPathComponent(file);
361  file = absolute_path.GetPath();
362  }
363 
364  return std::make_unique<MultiLoader<T>>(std::move(files));
365  }
366 
367  llvm::Optional<std::string> GetNextFile() {
368  if (m_index >= m_files.size())
369  return {};
370  return m_files[m_index++];
371  }
372 
373 private:
374  std::vector<std::string> m_files;
375  unsigned m_index = 0;
376 };
377 
379 public:
380  SymbolFileLoader(Loader *loader);
381  std::pair<FileSpec, FileSpec> GetPaths(const UUID *uuid) const;
382 
383 private:
384  // Sorted list of UUID to path mappings.
385  std::vector<SymbolFileProvider::Entry> m_symbol_files;
386 };
387 
388 /// Helper to read directories written by the DirectoryProvider.
389 template <typename T>
390 llvm::Expected<std::string> GetDirectoryFrom(repro::Loader *loader) {
391  llvm::Expected<std::string> dir = loader->LoadBuffer<T>();
392  if (!dir)
393  return dir.takeError();
394  return std::string(llvm::StringRef(*dir).rtrim());
395 }
396 
397 } // namespace repro
398 } // namespace lldb_private
399 
400 LLVM_YAML_IS_SEQUENCE_VECTOR(lldb_private::repro::SymbolFileProvider::Entry)
401 
402 namespace llvm {
403 namespace yaml {
404 template <>
406  static void mapping(IO &io,
408  io.mapRequired("uuid", entry.uuid);
409  io.mapRequired("module-path", entry.module_path);
410  io.mapRequired("symbol-path", entry.symbol_path);
411  }
412 };
413 } // namespace yaml
414 } // namespace llvm
415 
416 #endif // LLDB_UTILITY_REPRODUCER_PROVIDER_H
lldb_private::repro::FileProvider::Info::file
static const char * file
Definition: ReproducerProvider.h:98
lldb_private::repro::SymbolFileProvider::Entry
Definition: ReproducerProvider.h:213
lldb_private::repro::ProcessInfoProvider::Info::name
static const char * name
Definition: ReproducerProvider.h:315
lldb_private::UUID
Definition: UUID.h:23
lldb_private::repro::WorkingDirectoryProvider::Info::name
static const char * name
Definition: ReproducerProvider.h:179
llvm
Definition: Debugger.h:50
lldb_private::repro::SymbolFileProvider::Entry::Entry
Entry(std::string uuid, std::string module_path, std::string symbol_path)
Definition: ReproducerProvider.h:216
lldb_private::repro::VersionProvider::VersionProvider
VersionProvider(const FileSpec &directory)
Definition: ReproducerProvider.h:128
lldb_private::repro::FileProvider::RecordInterestingDirectory
void RecordInterestingDirectory(const llvm::Twine &dir)
Definition: ReproducerProvider.cpp:48
lldb_private::repro::VersionProvider::ID
static char ID
Definition: ReproducerProvider.h:139
lldb_private::repro::SymbolFileProvider::AddSymbolFile
void AddSymbolFile(const UUID *uuid, const FileSpec &module_path, const FileSpec &symbol_path)
Definition: ReproducerProvider.cpp:117
lldb_private::repro::ProcessInfoRecorder::Create
static llvm::Expected< std::unique_ptr< ProcessInfoRecorder > > Create(const FileSpec &filename)
Definition: ReproducerProvider.cpp:66
lldb_private::repro::SymbolFileProvider::Info
Definition: ReproducerProvider.h:228
lldb_private::repro::SymbolFileProvider::m_symbol_files
std::vector< Entry > m_symbol_files
Definition: ReproducerProvider.h:235
lldb_private::repro::MultiLoader::m_index
unsigned m_index
Definition: ReproducerProvider.h:375
lldb_private::repro::MultiProvider::Discard
void Discard() override
The Discard method is called when it is decided that we do not need to keep any information and will ...
Definition: ReproducerProvider.h:282
lldb_private::repro::ProcessInfoRecorder::Record
void Record(const ProcessInstanceInfoList &process_infos)
Definition: ReproducerProvider.cpp:109
UUID.h
lldb_private::repro::YamlRecorder::Create
static llvm::Expected< std::unique_ptr< YamlRecorder > > Create(const FileSpec &filename)
Definition: ReproducerProvider.cpp:31
lldb_private::repro::FileProvider::Info::name
static const char * name
Definition: ReproducerProvider.h:97
lldb_private::repro::CommandProvider::Info
Definition: ReproducerProvider.h:290
lldb_private::repro::HomeDirectoryProvider::Info::file
static const char * file
Definition: ReproducerProvider.h:199
lldb_private::repro::MultiLoader::Create
static std::unique_ptr< MultiLoader > Create(Loader *loader)
Definition: ReproducerProvider.h:339
lldb_private::repro::WorkingDirectoryProvider::Info
Definition: ReproducerProvider.h:178
lldb_private::repro::MultiLoader::GetNextFile
llvm::Optional< std::string > GetNextFile()
Definition: ReproducerProvider.h:367
lldb_private::repro::YamlRecorder
Recorder that records its data as YAML to a file.
Definition: ReproducerProvider.h:74
lldb_private::repro::DirectoryProvider::DirectoryProvider
DirectoryProvider(const FileSpec &root)
Definition: ReproducerProvider.h:145
lldb_private::repro::SymbolFileProvider::Entry::operator<
bool operator<(const Entry &rhs) const
Definition: ReproducerProvider.h:221
Reproducer.h
lldb_private::repro::SymbolFileProvider::Info::file
static const char * file
Definition: ReproducerProvider.h:230
lldb_private::repro::Provider
Definition: Reproducer.h:73
lldb_private::repro::DataRecorder
Recorder that records its data as text to a file.
Definition: ReproducerProvider.h:55
lldb_private::repro::DirectoryProvider::Keep
void Keep() override
The Keep method is called when it is decided that we need to keep the data in order to provide a repr...
Definition: ReproducerProvider.h:151
lldb_private::repro::DataRecorder::DataRecorder
DataRecorder(const FileSpec &filename, std::error_code &ec)
Definition: ReproducerProvider.h:57
lldb_private::repro::AbstractRecorder::GetFilename
const FileSpec & GetFilename()
Definition: ReproducerProvider.h:39
lldb_private::repro::MultiLoader
Loader for data captured with the MultiProvider.
Definition: ReproducerProvider.h:335
lldb_private::repro::GetDirectoryFrom
llvm::Expected< std::string > GetDirectoryFrom(repro::Loader *loader)
Helper to read directories written by the DirectoryProvider.
Definition: ReproducerProvider.h:390
lldb_private::repro::DirectoryProvider
Abstract provider to storing directory paths.
Definition: ReproducerProvider.h:143
lldb_private::repro::Loader
Definition: Reproducer.h:156
lldb_private::repro::ProcessInfoRecorder
Definition: ReproducerProvider.h:301
lldb_private::repro::SymbolFileProvider::Entry::module_path
std::string module_path
Definition: ReproducerProvider.h:224
lldb_private::repro::FileProvider
Definition: ReproducerProvider.h:94
lldb_private::repro::ProcessInfoProvider::ID
static char ID
Definition: ReproducerProvider.h:326
lldb_private::repro::MultiProvider::MultiProvider
MultiProvider(const FileSpec &directory)
Definition: ReproducerProvider.h:248
lldb_private::repro::AbstractRecorder::m_record
bool m_record
Definition: ReproducerProvider.h:51
lldb_private::FileSpec
Definition: FileSpec.h:56
lldb_private::repro::MultiProvider
The MultiProvider is a provider that hands out recorder which can be used to capture data for differe...
Definition: ReproducerProvider.h:246
ProcessInfo.h
lldb_private::repro::ProcessInfoProvider
Definition: ReproducerProvider.h:312
lldb_private::repro::ProcessInfoRecorder::ProcessInfoRecorder
ProcessInfoRecorder(const FileSpec &filename, std::error_code &ec)
Definition: ReproducerProvider.h:303
lldb_private::repro::CommandProvider::Info::file
static const char * file
Definition: ReproducerProvider.h:292
lldb_private::repro::VersionProvider::Keep
void Keep() override
The Keep method is called when it is decided that we need to keep the data in order to provide a repr...
Definition: ReproducerProvider.cpp:39
lldb_private::repro::DataRecorder::Create
static llvm::Expected< std::unique_ptr< DataRecorder > > Create(const FileSpec &filename)
Definition: ReproducerProvider.cpp:22
lldb_private::repro::Loader::LoadBuffer
llvm::Expected< std::string > LoadBuffer()
Definition: Reproducer.h:167
lldb_private::repro::SymbolFileLoader::SymbolFileLoader
SymbolFileLoader(Loader *loader)
Definition: ReproducerProvider.cpp:143
lldb_private::repro::FileProvider::Keep
void Keep() override
The Keep method is called when it is decided that we need to keep the data in order to provide a repr...
Definition: ReproducerProvider.cpp:58
lldb_private::repro::SymbolFileProvider
Provider for mapping UUIDs to symbol and executable files.
Definition: ReproducerProvider.h:205
lldb_private::repro::VersionProvider::m_version
std::string m_version
Definition: ReproducerProvider.h:138
lldb_private::repro::AbstractRecorder::Stop
void Stop()
Definition: ReproducerProvider.h:41
lldb_private::repro::ProcessInfoProvider::Info
Definition: ReproducerProvider.h:314
lldb_private::repro::ProcessInfoProvider::ProcessInfoProvider
ProcessInfoProvider(const FileSpec &directory)
Definition: ReproducerProvider.h:319
lldb_private::repro::CommandProvider::Info::name
static const char * name
Definition: ReproducerProvider.h:291
lldb_private::repro::VersionProvider::Info
Definition: ReproducerProvider.h:129
lldb_private::repro::AbstractRecorder
The recorder is a small object handed out by a provider to record data.
Definition: ReproducerProvider.h:31
lldb_private::repro::FileProvider::FileProvider
FileProvider(const FileSpec &directory)
Definition: ReproducerProvider.h:101
lldb_private::repro::HomeDirectoryProvider::ID
static char ID
Definition: ReproducerProvider.h:201
lldb_private::repro::SymbolFileProvider::SymbolFileProvider
SymbolFileProvider(const FileSpec &directory)
Definition: ReproducerProvider.h:207
lldb_private::repro::SymbolFileProvider::Entry::uuid
std::string uuid
Definition: ReproducerProvider.h:223
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::repro::MultiProvider::m_recorders
std::vector< std::unique_ptr< T > > m_recorders
Definition: ReproducerProvider.h:285
lldb_private::repro::SymbolFileProvider::Info::name
static const char * name
Definition: ReproducerProvider.h:229
lldb_private::repro::FileProvider::Info
Definition: ReproducerProvider.h:96
lldb_private::repro::SymbolFileProvider::Entry::Entry
Entry(std::string uuid)
Definition: ReproducerProvider.h:215
lldb_private::repro::HomeDirectoryProvider::Info::name
static const char * name
Definition: ReproducerProvider.h:198
lldb_private::FileSpec::CopyByAppendingPathComponent
FileSpec CopyByAppendingPathComponent(llvm::StringRef component) const
Definition: FileSpec.cpp:399
lldb_private::repro::SymbolFileProvider::Entry::Entry
Entry()=default
lldb_private::repro::AbstractRecorder::m_filename
FileSpec m_filename
Definition: ReproducerProvider.h:47
lldb_private::repro::VersionProvider
Provider for the LLDB version number.
Definition: ReproducerProvider.h:126
lldb_private::repro::MultiLoader::m_files
std::vector< std::string > m_files
Definition: ReproducerProvider.h:374
lldb_private::repro::HomeDirectoryProvider::HomeDirectoryProvider
HomeDirectoryProvider(const FileSpec &directory)
Definition: ReproducerProvider.h:191
lldb_private::repro::VersionProvider::Info::name
static const char * name
Definition: ReproducerProvider.h:130
lldb_private::repro::MultiProvider::GetNewRecorder
T * GetNewRecorder()
Definition: ReproducerProvider.h:250
lldb_private::repro::SymbolFileProvider::ID
static char ID
Definition: ReproducerProvider.h:232
lldb_private::repro::SymbolFileProvider::Entry::operator==
bool operator==(const Entry &rhs) const
Definition: ReproducerProvider.h:220
lldb_private::repro::CommandProvider
Definition: ReproducerProvider.h:288
lldb_private::repro::ProcessInfoProvider::GetNewProcessInfoRecorder
ProcessInfoRecorder * GetNewProcessInfoRecorder()
Definition: ReproducerProvider.cpp:93
lldb_private::repro::ProcessInfoProvider::m_stream_up
std::unique_ptr< llvm::raw_fd_ostream > m_stream_up
Definition: ReproducerProvider.h:329
lldb_private::repro::FileProvider::RecordInterestingDirectoryRecursive
void RecordInterestingDirectoryRecursive(const llvm::Twine &dir)
Definition: ReproducerProvider.cpp:53
lldb_private::repro::CommandProvider::ID
static char ID
Definition: ReproducerProvider.h:298
lldb_private::repro::FileProvider::ID
static char ID
Definition: ReproducerProvider.h:116
lldb_private::repro::DataRecorder::Record
void Record(const T &t, bool newline=false)
Definition: ReproducerProvider.h:63
lldb_private::repro::SymbolFileLoader
Definition: ReproducerProvider.h:378
lldb_private::repro::VersionProvider::SetVersion
void SetVersion(std::string version)
Definition: ReproducerProvider.h:133
lldb_private::repro::DirectoryProvider::m_directory
std::string m_directory
Definition: ReproducerProvider.h:161
lldb_private::repro::WorkingDirectoryProvider::Info::file
static const char * file
Definition: ReproducerProvider.h:180
lldb_private::repro::FileProvider::GetFileCollector
std::shared_ptr< llvm::FileCollector > GetFileCollector()
Definition: ReproducerProvider.h:107
lldb_private::repro::AbstractRecorder::AbstractRecorder
AbstractRecorder(const FileSpec &filename, std::error_code &ec)
Definition: ReproducerProvider.h:33
lldb_private::repro::MultiLoader::MultiLoader
MultiLoader(std::vector< std::string > files)
Definition: ReproducerProvider.h:337
lldb_private::repro::ProcessInfoProvider::Keep
void Keep() override
The Keep method is called when it is decided that we need to keep the data in order to provide a repr...
Definition: ReproducerProvider.cpp:75
lldb_private::repro::MultiProvider::Keep
void Keep() override
The Keep method is called when it is decided that we need to keep the data in order to provide a repr...
Definition: ReproducerProvider.h:266
lldb_private::repro::VersionProvider::Info::file
static const char * file
Definition: ReproducerProvider.h:131
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::repro::CommandProvider::CommandProvider
CommandProvider(const FileSpec &directory)
Definition: ReproducerProvider.h:295
lldb_private::repro::AbstractRecorder::m_os
llvm::raw_fd_ostream m_os
Definition: ReproducerProvider.h:50
FileSpec.h
lldb_private::repro::Loader::GetFile
FileSpec GetFile()
Definition: Reproducer.h:160
Entry
FormatEntity::Entry Entry
Definition: FormatEntity.cpp:82
lldb_private::repro::SymbolFileLoader::m_symbol_files
std::vector< SymbolFileProvider::Entry > m_symbol_files
Definition: ReproducerProvider.h:385
lldb_private::repro::SymbolFileProvider::Keep
void Keep() override
The Keep method is called when it is decided that we need to keep the data in order to provide a repr...
Definition: ReproducerProvider.cpp:126
lldb_private::repro::FileProvider::m_collector
std::shared_ptr< llvm::FileCollector > m_collector
Definition: ReproducerProvider.h:119
lldb_private::repro::SymbolFileProvider::Entry::symbol_path
std::string symbol_path
Definition: ReproducerProvider.h:225
lldb_private::repro::ProviderBase::GetRoot
const FileSpec & GetRoot() const
Definition: Reproducer.h:43
lldb_private::repro::WorkingDirectoryProvider::WorkingDirectoryProvider
WorkingDirectoryProvider(const FileSpec &directory)
Definition: ReproducerProvider.h:171
lldb_private::FileSpec::GetPath
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
Definition: FileSpec.cpp:347
lldb_private::repro::Loader::GetRoot
const FileSpec & GetRoot() const
Definition: Reproducer.h:178
lldb_private::repro::HomeDirectoryProvider
Provider for the home directory.
Definition: ReproducerProvider.h:189
lldb_private::repro::ProcessInfoProvider::m_process_info_recorders
std::vector< std::unique_ptr< ProcessInfoRecorder > > m_process_info_recorders
Definition: ReproducerProvider.h:330
lldb_private::ProcessInstanceInfoList
std::vector< ProcessInstanceInfo > ProcessInstanceInfoList
Definition: Host.h:30
lldb_private::repro::DirectoryProvider::SetDirectory
void SetDirectory(std::string directory)
Definition: ReproducerProvider.h:146
lldb_private::repro::ProcessInfoProvider::Discard
void Discard() override
The Discard method is called when it is decided that we do not need to keep any information and will ...
Definition: ReproducerProvider.cpp:91
lldb_private::repro::YamlRecorder::YamlRecorder
YamlRecorder(const FileSpec &filename, std::error_code &ec)
Definition: ReproducerProvider.h:76
lldb_private::repro::YamlRecorder::Record
void Record(const T &t)
Definition: ReproducerProvider.h:82
lldb_private::repro::ProcessInfoProvider::Info::file
static const char * file
Definition: ReproducerProvider.h:316
lldb_private::repro::SymbolFileLoader::GetPaths
std::pair< FileSpec, FileSpec > GetPaths(const UUID *uuid) const
Definition: ReproducerProvider.cpp:160
lldb_private::repro::WorkingDirectoryProvider
Provider for the current working directory.
Definition: ReproducerProvider.h:168
lldb_private::repro::HomeDirectoryProvider::Info
Definition: ReproducerProvider.h:197
llvm::yaml::MappingTraits< lldb_private::repro::SymbolFileProvider::Entry >::mapping
static void mapping(IO &io, lldb_private::repro::SymbolFileProvider::Entry &entry)
Definition: ReproducerProvider.h:406
lldb_private::repro::WorkingDirectoryProvider::ID
static char ID
Definition: ReproducerProvider.h:182
lldb_private::repro::DirectoryProvider::GetDirectory
llvm::StringRef GetDirectory()
Definition: ReproducerProvider.h:149