LLDB mainline
|
#include <cerrno>
#include "lldb/Host/Config.h"
#include <chrono>
#include <cstring>
#include <limits>
#include <optional>
#include <thread>
#include "GDBRemoteCommunicationServerLLGS.h"
#include "lldb/Host/ConnectionFileDescriptor.h"
#include "lldb/Host/Debug.h"
#include "lldb/Host/File.h"
#include "lldb/Host/FileAction.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/PosixApi.h"
#include "lldb/Host/Socket.h"
#include "lldb/Host/common/NativeProcessProtocol.h"
#include "lldb/Host/common/NativeRegisterContext.h"
#include "lldb/Host/common/NativeThreadProtocol.h"
#include "lldb/Target/MemoryRegionInfo.h"
#include "lldb/Utility/Args.h"
#include "lldb/Utility/DataBuffer.h"
#include "lldb/Utility/Endian.h"
#include "lldb/Utility/GDBRemote.h"
#include "lldb/Utility/LLDBAssert.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/State.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/UnimplementedError.h"
#include "lldb/Utility/UriParser.h"
#include "llvm/Support/JSON.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/TargetParser/Triple.h"
#include "ProcessGDBRemote.h"
#include "ProcessGDBRemoteLog.h"
#include "lldb/Utility/StringExtractorGDBRemote.h"
Go to the source code of this file.
Functions | |
static void | AppendHexValue (StreamString &response, const uint8_t *buf, uint32_t buf_size, bool swap) |
static llvm::StringRef | GetEncodingNameOrEmpty (const RegisterInfo ®_info) |
static llvm::StringRef | GetFormatNameOrEmpty (const RegisterInfo ®_info) |
static llvm::StringRef | GetKindGenericOrEmpty (const RegisterInfo ®_info) |
static void | CollectRegNums (const uint32_t *reg_num, StreamString &response, bool usehex) |
static void | WriteRegisterValueInHexFixedWidth (StreamString &response, NativeRegisterContext ®_ctx, const RegisterInfo ®_info, const RegisterValue *reg_value_p, lldb::ByteOrder byte_order) |
static std::optional< json::Object > | GetRegistersAsJSON (NativeThreadProtocol &thread) |
static const char * | GetStopReasonString (StopReason stop_reason) |
static llvm::Expected< json::Array > | GetJSONThreadsInfo (NativeProcessProtocol &process, bool abridged) |
static bool | ResumeActionListStopsAllThreads (ResumeActionList &actions) |
|
static |
Definition at line 510 of file GDBRemoteCommunicationServerLLGS.cpp.
References lldb_private::Stream::PutHex8(), and lldb_private::swap().
Referenced by WriteRegisterValueInHexFixedWidth().
|
static |
Definition at line 605 of file GDBRemoteCommunicationServerLLGS.cpp.
References LLDB_INVALID_REGNUM, lldb_private::Stream::Printf(), and lldb_private::Stream::PutChar().
Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::BuildTargetXml(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qRegisterInfo().
|
static |
Definition at line 522 of file GDBRemoteCommunicationServerLLGS.cpp.
References lldb::eEncodingIEEE754, lldb::eEncodingSint, lldb::eEncodingUint, lldb::eEncodingVector, and lldb_private::RegisterInfo::encoding.
Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::BuildTargetXml(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qRegisterInfo().
|
static |
Definition at line 537 of file GDBRemoteCommunicationServerLLGS.cpp.
References lldb::eFormatBinary, lldb::eFormatDecimal, lldb::eFormatFloat, lldb::eFormatHex, lldb::eFormatVectorOfFloat32, lldb::eFormatVectorOfSInt16, lldb::eFormatVectorOfSInt32, lldb::eFormatVectorOfSInt8, lldb::eFormatVectorOfUInt128, lldb::eFormatVectorOfUInt16, lldb::eFormatVectorOfUInt32, lldb::eFormatVectorOfUInt64, lldb::eFormatVectorOfUInt8, and lldb_private::RegisterInfo::format.
Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::BuildTargetXml(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qRegisterInfo().
|
static |
Definition at line 730 of file GDBRemoteCommunicationServerLLGS.cpp.
References lldb_private::ThreadStopInfo::data, lldb_private::ThreadStopInfo::data_count, lldb_private::ThreadStopInfo::details, lldb::eStopReasonException, lldb_private::ThreadStopInfo::exception, lldb_private::NativeProcessProtocol::GetID(), lldb_private::GetLog(), GetRegistersAsJSON(), GetStopReasonString(), LLDB_LOGF, lldb_private::Process, lldb_private::ThreadStopInfo::reason, lldb_private::ThreadStopInfo::signo, lldb_private::Thread, lldb_private::NativeProcessProtocol::Threads(), and lldb_private::ThreadStopInfo::type.
Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_jThreadsInfo(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::PrepareStopReplyPacketForThread().
|
static |
Definition at line 570 of file GDBRemoteCommunicationServerLLGS.cpp.
References lldb_private::RegisterInfo::kinds, LLDB_REGNUM_GENERIC_ARG1, LLDB_REGNUM_GENERIC_ARG2, LLDB_REGNUM_GENERIC_ARG3, LLDB_REGNUM_GENERIC_ARG4, LLDB_REGNUM_GENERIC_ARG5, LLDB_REGNUM_GENERIC_ARG6, LLDB_REGNUM_GENERIC_ARG7, LLDB_REGNUM_GENERIC_ARG8, LLDB_REGNUM_GENERIC_FLAGS, LLDB_REGNUM_GENERIC_FP, LLDB_REGNUM_GENERIC_PC, LLDB_REGNUM_GENERIC_RA, LLDB_REGNUM_GENERIC_SP, and LLDB_REGNUM_GENERIC_TP.
Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::BuildTargetXml(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qRegisterInfo().
|
static |
Definition at line 643 of file GDBRemoteCommunicationServerLLGS.cpp.
References lldb::eByteOrderBig, error(), lldb_private::Full, lldb_private::NativeRegisterContext::GetExpeditedRegisters(), lldb_private::GetLog(), lldb_private::NativeThreadProtocol::GetRegisterContext(), lldb_private::NativeRegisterContext::GetRegisterInfoAtIndex(), lldb_private::StreamString::GetString(), LLDB_LOGF, lldb_private::Minimal, lldb_private::RegisterInfo::name, lldb_private::NativeRegisterContext::ReadRegister(), lldb_private::Thread, lldb_private::RegisterInfo::value_regs, and WriteRegisterValueInHexFixedWidth().
Referenced by GetJSONThreadsInfo().
|
static |
Definition at line 695 of file GDBRemoteCommunicationServerLLGS.cpp.
References lldb::eStopReasonBreakpoint, lldb::eStopReasonException, lldb::eStopReasonExec, lldb::eStopReasonFork, lldb::eStopReasonInstrumentation, lldb::eStopReasonInterrupt, lldb::eStopReasonInvalid, lldb::eStopReasonNone, lldb::eStopReasonPlanComplete, lldb::eStopReasonProcessorTrace, lldb::eStopReasonSignal, lldb::eStopReasonThreadExiting, lldb::eStopReasonTrace, lldb::eStopReasonVFork, lldb::eStopReasonVForkDone, and lldb::eStopReasonWatchpoint.
Referenced by GetJSONThreadsInfo(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::PrepareStopReplyPacketForThread().
|
static |
Definition at line 1683 of file GDBRemoteCommunicationServerLLGS.cpp.
References lldb::eStateSuspended, lldb_private::ResumeActionList::GetActionForThread(), lldb_private::ResumeActionList::GetSize(), and LLDB_INVALID_THREAD_ID.
Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vCont().
|
static |
Definition at line 617 of file GDBRemoteCommunicationServerLLGS.cpp.
References AppendHexValue(), lldb_private::RegisterInfo::byte_size, lldb::eByteOrderLittle, error(), lldb_private::RegisterValue::GetBytes(), lldb_private::RegisterValue::GetByteSize(), and lldb_private::NativeRegisterContext::ReadRegister().
Referenced by GetRegistersAsJSON(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::PrepareStopReplyPacketForThread().