diff options
| author | Eric Christopher <echristo@gmail.com> | 2019-12-10 15:04:02 -0800 |
|---|---|---|
| committer | Eric Christopher <echristo@gmail.com> | 2019-12-10 15:04:45 -0800 |
| commit | 1d41d1bcdfd70cf8f77bb32e2617392395c299a4 (patch) | |
| tree | de9be5c61d0c9efde2ae04ebc507c7f3b770da8c /lldb/source/Commands | |
| parent | f4a7d5659df7cb56c1baa34a39e9fe2639472741 (diff) | |
| download | bcm5719-llvm-1d41d1bcdfd70cf8f77bb32e2617392395c299a4.tar.gz bcm5719-llvm-1d41d1bcdfd70cf8f77bb32e2617392395c299a4.zip | |
Revert "Temporarily revert [lldb] e81268d - [lldb/Reproducers] Support multiple GDB remotes"
On multiple retry this issue won't duplicate - will revisit with author if
duplication works again.
This reverts commit c9e0b354e2749ce7ab553974692cb35c8651a869.
Diffstat (limited to 'lldb/source/Commands')
| -rw-r--r-- | lldb/source/Commands/CommandObjectReproducer.cpp | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/lldb/source/Commands/CommandObjectReproducer.cpp b/lldb/source/Commands/CommandObjectReproducer.cpp index a4c69db492d..0f05c564a0d 100644 --- a/lldb/source/Commands/CommandObjectReproducer.cpp +++ b/lldb/source/Commands/CommandObjectReproducer.cpp @@ -407,10 +407,9 @@ protected: return true; } case eReproducerProviderCommands: { - // Create a new command loader. - std::unique_ptr<repro::CommandLoader> command_loader = - repro::CommandLoader::Create(loader); - if (!command_loader) { + std::unique_ptr<repro::MultiLoader<repro::CommandProvider>> multi_loader = + repro::MultiLoader<repro::CommandProvider>::Create(loader); + if (!multi_loader) { SetError(result, make_error<StringError>(llvm::inconvertibleErrorCode(), "Unable to create command loader.")); @@ -418,9 +417,8 @@ protected: } // Iterate over the command files and dump them. - while (true) { - llvm::Optional<std::string> command_file = - command_loader->GetNextFile(); + llvm::Optional<std::string> command_file; + while ((command_file = multi_loader->GetNextFile())) { if (!command_file) break; @@ -436,24 +434,29 @@ protected: return true; } case eReproducerProviderGDB: { - FileSpec gdb_file = loader->GetFile<ProcessGDBRemoteProvider::Info>(); - auto error_or_file = MemoryBuffer::getFile(gdb_file.GetPath()); - if (auto err = error_or_file.getError()) { - SetError(result, errorCodeToError(err)); - return false; - } + std::unique_ptr<repro::MultiLoader<repro::GDBRemoteProvider>> + multi_loader = + repro::MultiLoader<repro::GDBRemoteProvider>::Create(loader); + llvm::Optional<std::string> gdb_file; + while ((gdb_file = multi_loader->GetNextFile())) { + auto error_or_file = MemoryBuffer::getFile(*gdb_file); + if (auto err = error_or_file.getError()) { + SetError(result, errorCodeToError(err)); + return false; + } - std::vector<GDBRemotePacket> packets; - yaml::Input yin((*error_or_file)->getBuffer()); - yin >> packets; + std::vector<GDBRemotePacket> packets; + yaml::Input yin((*error_or_file)->getBuffer()); + yin >> packets; - if (auto err = yin.error()) { - SetError(result, errorCodeToError(err)); - return false; - } + if (auto err = yin.error()) { + SetError(result, errorCodeToError(err)); + return false; + } - for (GDBRemotePacket &packet : packets) { - packet.Dump(result.GetOutputStream()); + for (GDBRemotePacket &packet : packets) { + packet.Dump(result.GetOutputStream()); + } } result.SetStatus(eReturnStatusSuccessFinishResult); |

