Revert "[lldb] Add reproducer verifier"
This reverts commit 297f69afac. It broke
the Fedora 33 x86-64 bot. See the review for more info.
This commit is contained in:
@@ -30,33 +30,6 @@ using namespace lldb;
|
||||
using namespace lldb_private;
|
||||
using namespace lldb_private::repro;
|
||||
|
||||
SBReplayOptions::SBReplayOptions()
|
||||
: m_opaque_up(std::make_unique<ReplayOptions>()){};
|
||||
|
||||
SBReplayOptions::SBReplayOptions(const SBReplayOptions &rhs)
|
||||
: m_opaque_up(std::make_unique<ReplayOptions>(*rhs.m_opaque_up)) {}
|
||||
|
||||
SBReplayOptions::~SBReplayOptions() = default;
|
||||
|
||||
SBReplayOptions &SBReplayOptions::operator=(const SBReplayOptions &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; }
|
||||
|
||||
bool SBReplayOptions::GetVerify() const { return m_opaque_up->verify; }
|
||||
|
||||
void SBReplayOptions::SetCheckVersion(bool check) {
|
||||
m_opaque_up->check_version = check;
|
||||
}
|
||||
|
||||
bool SBReplayOptions::GetCheckVersion() const {
|
||||
return m_opaque_up->check_version;
|
||||
}
|
||||
|
||||
SBRegistry::SBRegistry() {
|
||||
Registry &R = *this;
|
||||
|
||||
@@ -190,18 +163,10 @@ const char *SBReproducer::PassiveReplay(const char *path) {
|
||||
}
|
||||
|
||||
const char *SBReproducer::Replay(const char *path) {
|
||||
SBReplayOptions options;
|
||||
return SBReproducer::Replay(path, options);
|
||||
return SBReproducer::Replay(path, false);
|
||||
}
|
||||
|
||||
const char *SBReproducer::Replay(const char *path, bool skip_version_check) {
|
||||
SBReplayOptions options;
|
||||
options.SetCheckVersion(!skip_version_check);
|
||||
return SBReproducer::Replay(path, options);
|
||||
}
|
||||
|
||||
const char *SBReproducer::Replay(const char *path,
|
||||
const SBReplayOptions &options) {
|
||||
static std::string error;
|
||||
if (auto e = Reproducer::Initialize(ReproducerMode::Replay, FileSpec(path))) {
|
||||
error = llvm::toString(std::move(e));
|
||||
@@ -214,7 +179,7 @@ const char *SBReproducer::Replay(const char *path,
|
||||
return error.c_str();
|
||||
}
|
||||
|
||||
if (options.GetCheckVersion()) {
|
||||
if (!skip_version_check) {
|
||||
llvm::Expected<std::string> version = loader->LoadBuffer<VersionProvider>();
|
||||
if (!version) {
|
||||
error = llvm::toString(version.takeError());
|
||||
@@ -230,30 +195,6 @@ const char *SBReproducer::Replay(const char *path,
|
||||
}
|
||||
}
|
||||
|
||||
if (options.GetVerify()) {
|
||||
bool verification_failed = false;
|
||||
llvm::raw_string_ostream os(error);
|
||||
auto error_callback = [&](llvm::StringRef error) {
|
||||
verification_failed = true;
|
||||
os << "\nerror: " << error;
|
||||
};
|
||||
|
||||
auto warning_callback = [&](llvm::StringRef warning) {
|
||||
verification_failed = true;
|
||||
os << "\nwarning: " << warning;
|
||||
};
|
||||
|
||||
auto note_callback = [&](llvm::StringRef warning) {};
|
||||
|
||||
Verifier verifier(loader);
|
||||
verifier.Verify(error_callback, warning_callback, note_callback);
|
||||
|
||||
if (verification_failed) {
|
||||
os.flush();
|
||||
return error.c_str();
|
||||
}
|
||||
}
|
||||
|
||||
FileSpec file = loader->GetFile<SBProvider::Info>();
|
||||
if (!file) {
|
||||
error = "unable to get replay data from reproducer.";
|
||||
|
||||
Reference in New Issue
Block a user