diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2023-09-02 21:17:18 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2023-12-08 17:34:50 +0000 |
commit | 06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e (patch) | |
tree | 62f873df87c7c675557a179e0c4c83fe9f3087bc /contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | |
parent | cf037972ea8863e2bab7461d77345367d2c1e054 (diff) | |
parent | 7fa27ce4a07f19b07799a767fc29416f3b625afb (diff) |
Diffstat (limited to 'contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp')
-rw-r--r-- | contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp index 921c149b9762..4efc454967a1 100644 --- a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -37,14 +37,13 @@ #include "lldb/Utility/LLDBAssert.h" #include "lldb/Utility/LLDBLog.h" #include "lldb/Utility/Log.h" -#include "lldb/Utility/RegisterValue.h" #include "lldb/Utility/State.h" #include "lldb/Utility/StreamString.h" #include "lldb/Utility/UnimplementedError.h" #include "lldb/Utility/UriParser.h" -#include "llvm/ADT/Triple.h" #include "llvm/Support/JSON.h" #include "llvm/Support/ScopedPrinter.h" +#include "llvm/TargetParser/Triple.h" #include "ProcessGDBRemote.h" #include "ProcessGDBRemoteLog.h" @@ -69,9 +68,9 @@ enum GDBRemoteServerError { // GDBRemoteCommunicationServerLLGS constructor GDBRemoteCommunicationServerLLGS::GDBRemoteCommunicationServerLLGS( - MainLoop &mainloop, const NativeProcessProtocol::Factory &process_factory) + MainLoop &mainloop, NativeProcessProtocol::Manager &process_manager) : GDBRemoteCommunicationServerCommon(), m_mainloop(mainloop), - m_process_factory(process_factory), m_current_process(nullptr), + m_process_manager(process_manager), m_current_process(nullptr), m_continue_process(nullptr), m_stdio_communication() { RegisterPacketHandlers(); } @@ -286,8 +285,7 @@ Status GDBRemoteCommunicationServerLLGS::LaunchProcess() { std::lock_guard<std::recursive_mutex> guard(m_debugged_process_mutex); assert(m_debugged_processes.empty() && "lldb-server creating debugged " "process but one already exists"); - auto process_or = - m_process_factory.Launch(m_process_launch_info, *this, m_mainloop); + auto process_or = m_process_manager.Launch(m_process_launch_info, *this); if (!process_or) return Status(process_or.takeError()); m_continue_process = m_current_process = process_or->get(); @@ -356,7 +354,7 @@ Status GDBRemoteCommunicationServerLLGS::AttachToProcess(lldb::pid_t pid) { pid, m_current_process->GetID()); // Try to attach. - auto process_or = m_process_factory.Attach(pid, *this, m_mainloop); + auto process_or = m_process_manager.Attach(pid, *this); if (!process_or) { Status status(process_or.takeError()); llvm::errs() << llvm::formatv("failed to attach to process {0}: {1}\n", pid, @@ -2267,8 +2265,7 @@ GDBRemoteCommunicationServerLLGS::Handle_P(StringExtractorGDBRemote &packet) { packet, "P packet missing '=' char after register number"); // Parse out the value. - uint8_t reg_bytes[RegisterValue::kMaxRegisterByteSize]; - size_t reg_size = packet.GetHexBytesAvail(reg_bytes); + size_t reg_size = packet.GetHexBytesAvail(m_reg_bytes); // Get the thread to use. NativeThreadProtocol *thread = GetThreadFromSuffix(packet); @@ -2307,7 +2304,7 @@ GDBRemoteCommunicationServerLLGS::Handle_P(StringExtractorGDBRemote &packet) { // Build the reginfos response. StreamGDBRemote response; - RegisterValue reg_value(ArrayRef(reg_bytes, reg_size), + RegisterValue reg_value(ArrayRef(m_reg_bytes, reg_size), m_current_process->GetArchitecture().GetByteOrder()); Status error = reg_context.WriteRegister(reg_info, reg_value); if (error.Fail()) { @@ -4209,7 +4206,7 @@ std::vector<std::string> GDBRemoteCommunicationServerLLGS::HandleFeatures( // report server-only features using Extension = NativeProcessProtocol::Extension; - Extension plugin_features = m_process_factory.GetSupportedExtensions(); + Extension plugin_features = m_process_manager.GetSupportedExtensions(); if (bool(plugin_features & Extension::pass_signals)) ret.push_back("QPassSignals+"); if (bool(plugin_features & Extension::auxv)) @@ -4255,7 +4252,7 @@ std::vector<std::string> GDBRemoteCommunicationServerLLGS::HandleFeatures( void GDBRemoteCommunicationServerLLGS::SetEnabledExtensions( NativeProcessProtocol &process) { NativeProcessProtocol::Extension flags = m_extensions_supported; - assert(!bool(flags & ~m_process_factory.GetSupportedExtensions())); + assert(!bool(flags & ~m_process_manager.GetSupportedExtensions())); process.SetEnabledExtensions(flags); } |