summaryrefslogtreecommitdiff
path: root/lldb/source/API/SBReproducer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/API/SBReproducer.cpp')
-rw-r--r--lldb/source/API/SBReproducer.cpp120
1 files changed, 24 insertions, 96 deletions
diff --git a/lldb/source/API/SBReproducer.cpp b/lldb/source/API/SBReproducer.cpp
index c9c9a03c694a..d3d27cc57748 100644
--- a/lldb/source/API/SBReproducer.cpp
+++ b/lldb/source/API/SBReproducer.cpp
@@ -6,8 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "SBReproducerPrivate.h"
-
+#include "lldb/API/SBReproducer.h"
#include "lldb/API/LLDB.h"
#include "lldb/API/SBAddress.h"
#include "lldb/API/SBAttachInfo.h"
@@ -21,8 +20,10 @@
#include "lldb/API/SBError.h"
#include "lldb/API/SBFileSpec.h"
#include "lldb/API/SBHostOS.h"
-#include "lldb/API/SBReproducer.h"
#include "lldb/Host/FileSystem.h"
+#include "lldb/Utility/Instrumentation.h"
+#include "lldb/Utility/Reproducer.h"
+#include "lldb/Utility/ReproducerProvider.h"
#include "lldb/Version/Version.h"
using namespace lldb;
@@ -38,117 +39,44 @@ SBReplayOptions::SBReplayOptions(const SBReplayOptions &rhs)
SBReplayOptions::~SBReplayOptions() = default;
SBReplayOptions &SBReplayOptions::operator=(const SBReplayOptions &rhs) {
+ LLDB_INSTRUMENT_VA(this, rhs)
if (this == &rhs)
return *this;
*m_opaque_up = *rhs.m_opaque_up;
return *this;
}
-void SBReplayOptions::SetVerify(bool verify) { m_opaque_up->verify = verify; }
+void SBReplayOptions::SetVerify(bool verify) {
+ LLDB_INSTRUMENT_VA(this, verify) m_opaque_up->verify = verify;
+}
-bool SBReplayOptions::GetVerify() const { return m_opaque_up->verify; }
+bool SBReplayOptions::GetVerify() const {
+ LLDB_INSTRUMENT_VA(this) return m_opaque_up->verify;
+}
void SBReplayOptions::SetCheckVersion(bool check) {
+ LLDB_INSTRUMENT_VA(this, check)
m_opaque_up->check_version = check;
}
bool SBReplayOptions::GetCheckVersion() const {
+ LLDB_INSTRUMENT_VA(this)
return m_opaque_up->check_version;
}
-SBRegistry::SBRegistry() {
- Registry &R = *this;
-
- RegisterMethods<SBAddress>(R);
- RegisterMethods<SBAttachInfo>(R);
- RegisterMethods<SBBlock>(R);
- RegisterMethods<SBBreakpoint>(R);
- RegisterMethods<SBBreakpointList>(R);
- RegisterMethods<SBBreakpointLocation>(R);
- RegisterMethods<SBBreakpointName>(R);
- RegisterMethods<SBBroadcaster>(R);
- RegisterMethods<SBCommandInterpreter>(R);
- RegisterMethods<SBCommandInterpreterRunOptions>(R);
- RegisterMethods<SBCommandReturnObject>(R);
- RegisterMethods<SBCommunication>(R);
- RegisterMethods<SBCompileUnit>(R);
- RegisterMethods<SBData>(R);
- RegisterMethods<SBDebugger>(R);
- RegisterMethods<SBDeclaration>(R);
- RegisterMethods<SBEnvironment>(R);
- RegisterMethods<SBError>(R);
- RegisterMethods<SBEvent>(R);
- RegisterMethods<SBExecutionContext>(R);
- RegisterMethods<SBExpressionOptions>(R);
- RegisterMethods<SBFile>(R);
- RegisterMethods<SBFileSpec>(R);
- RegisterMethods<SBFileSpecList>(R);
- RegisterMethods<SBFrame>(R);
- RegisterMethods<SBFunction>(R);
- RegisterMethods<SBHostOS>(R);
- RegisterMethods<SBInputReader>(R);
- RegisterMethods<SBInstruction>(R);
- RegisterMethods<SBInstructionList>(R);
- RegisterMethods<SBLanguageRuntime>(R);
- RegisterMethods<SBLaunchInfo>(R);
- RegisterMethods<SBLineEntry>(R);
- RegisterMethods<SBListener>(R);
- RegisterMethods<SBMemoryRegionInfo>(R);
- RegisterMethods<SBMemoryRegionInfoList>(R);
- RegisterMethods<SBModule>(R);
- RegisterMethods<SBModuleSpec>(R);
- RegisterMethods<SBPlatform>(R);
- RegisterMethods<SBPlatformConnectOptions>(R);
- RegisterMethods<SBPlatformShellCommand>(R);
- RegisterMethods<SBProcess>(R);
- RegisterMethods<SBProcessInfo>(R);
- RegisterMethods<SBQueue>(R);
- RegisterMethods<SBQueueItem>(R);
- RegisterMethods<SBSection>(R);
- RegisterMethods<SBSourceManager>(R);
- RegisterMethods<SBStream>(R);
- RegisterMethods<SBStringList>(R);
- RegisterMethods<SBStructuredData>(R);
- RegisterMethods<SBSymbol>(R);
- RegisterMethods<SBSymbolContext>(R);
- RegisterMethods<SBSymbolContextList>(R);
- RegisterMethods<SBTarget>(R);
- RegisterMethods<SBThread>(R);
- RegisterMethods<SBThreadCollection>(R);
- RegisterMethods<SBThreadPlan>(R);
- RegisterMethods<SBTrace>(R);
- RegisterMethods<SBType>(R);
- RegisterMethods<SBTypeCategory>(R);
- RegisterMethods<SBTypeEnumMember>(R);
- RegisterMethods<SBTypeFilter>(R);
- RegisterMethods<SBTypeFormat>(R);
- RegisterMethods<SBTypeNameSpecifier>(R);
- RegisterMethods<SBTypeSummary>(R);
- RegisterMethods<SBTypeSummaryOptions>(R);
- RegisterMethods<SBTypeSynthetic>(R);
- RegisterMethods<SBUnixSignals>(R);
- RegisterMethods<SBValue>(R);
- RegisterMethods<SBValueList>(R);
- RegisterMethods<SBVariablesOptions>(R);
- RegisterMethods<SBWatchpoint>(R);
-}
-
const char *SBReproducer::Capture() {
+ LLDB_INSTRUMENT()
static std::string error;
if (auto e = Reproducer::Initialize(ReproducerMode::Capture, llvm::None)) {
error = llvm::toString(std::move(e));
return error.c_str();
}
- if (auto *g = lldb_private::repro::Reproducer::Instance().GetGenerator()) {
- auto &p = g->GetOrCreate<SBProvider>();
- InstrumentationData::Initialize(p.GetSerializer(), p.GetRegistry());
- }
-
return nullptr;
}
const char *SBReproducer::Capture(const char *path) {
+ LLDB_INSTRUMENT_VA(path)
static std::string error;
if (auto e =
Reproducer::Initialize(ReproducerMode::Capture, FileSpec(path))) {
@@ -156,32 +84,32 @@ const char *SBReproducer::Capture(const char *path) {
return error.c_str();
}
- if (auto *g = lldb_private::repro::Reproducer::Instance().GetGenerator()) {
- auto &p = g->GetOrCreate<SBProvider>();
- InstrumentationData::Initialize(p.GetSerializer(), p.GetRegistry());
- }
-
return nullptr;
}
const char *SBReproducer::PassiveReplay(const char *path) {
+ LLDB_INSTRUMENT_VA(path)
return "Reproducer replay has been removed";
}
const char *SBReproducer::Replay(const char *path) {
+ LLDB_INSTRUMENT_VA(path)
return "Reproducer replay has been removed";
}
const char *SBReproducer::Replay(const char *path, bool skip_version_check) {
+ LLDB_INSTRUMENT_VA(path, skip_version_check)
return Replay(path);
}
const char *SBReproducer::Replay(const char *path,
const SBReplayOptions &options) {
+ LLDB_INSTRUMENT_VA(path, options)
return Replay(path);
}
const char *SBReproducer::Finalize(const char *path) {
+ LLDB_INSTRUMENT_VA(path)
static std::string error;
repro::Loader *loader = repro::Reproducer::Instance().GetLoader();
@@ -199,6 +127,7 @@ const char *SBReproducer::Finalize(const char *path) {
}
bool SBReproducer::Generate() {
+ LLDB_INSTRUMENT()
auto &r = Reproducer::Instance();
if (auto generator = r.GetGenerator()) {
generator->Keep();
@@ -208,6 +137,7 @@ bool SBReproducer::Generate() {
}
bool SBReproducer::SetAutoGenerate(bool b) {
+ LLDB_INSTRUMENT_VA(b)
auto &r = Reproducer::Instance();
if (auto generator = r.GetGenerator()) {
generator->SetAutoGenerate(b);
@@ -217,6 +147,7 @@ bool SBReproducer::SetAutoGenerate(bool b) {
}
const char *SBReproducer::GetPath() {
+ LLDB_INSTRUMENT()
ConstString path;
auto &r = Reproducer::Instance();
if (FileSpec reproducer_path = Reproducer::Instance().GetReproducerPath())
@@ -225,6 +156,7 @@ const char *SBReproducer::GetPath() {
}
void SBReproducer::SetWorkingDirectory(const char *path) {
+ LLDB_INSTRUMENT_VA(path)
if (auto *g = lldb_private::repro::Reproducer::Instance().GetGenerator()) {
auto &wp = g->GetOrCreate<repro::WorkingDirectoryProvider>();
wp.SetDirectory(path);
@@ -232,7 +164,3 @@ void SBReproducer::SetWorkingDirectory(const char *path) {
fp.RecordInterestingDirectory(wp.GetDirectory());
}
}
-
-char lldb_private::repro::SBProvider::ID = 0;
-const char *SBProvider::Info::name = "sbapi";
-const char *SBProvider::Info::file = "sbapi.bin";