LLDB mainline
|
#include <CommunicationKDP.h>
Public Types | |
enum | CommandType { KDP_CONNECT = 0u , KDP_DISCONNECT , KDP_HOSTINFO , KDP_VERSION , KDP_MAXBYTES , KDP_READMEM , KDP_WRITEMEM , KDP_READREGS , KDP_WRITEREGS , KDP_LOAD , KDP_IMAGEPATH , KDP_SUSPEND , KDP_RESUMECPUS , KDP_EXCEPTION , KDP_TERMINATION , KDP_BREAKPOINT_SET , KDP_BREAKPOINT_REMOVE , KDP_REGIONS , KDP_REATTACH , KDP_HOSTREBOOT , KDP_READMEM64 , KDP_WRITEMEM64 , KDP_BREAKPOINT_SET64 , KDP_BREAKPOINT_REMOVE64 , KDP_KERNELVERSION , KDP_READPHYSMEM64 , KDP_WRITEPHYSMEM64 , KDP_READIOPORT , KDP_WRITEIOPORT , KDP_READMSR64 , KDP_WRITEMSR64 , KDP_DUMPINFO } |
enum | { KDP_FEATURE_BP = (1u << 0) } |
enum | KDPError { KDP_PROTERR_SUCCESS = 0 , KDP_PROTERR_ALREADY_CONNECTED , KDP_PROTERR_BAD_NBYTES , KDP_PROTERR_BADFLAVOR } |
enum | PacketType { ePacketTypeRequest = 0x00u , ePacketTypeReply = 0x80u , ePacketTypeMask = 0x80u , eCommandTypeMask = 0x7fu } |
typedef lldb_private::StreamBuffer< 4096 > | PacketStreamType |
Public Member Functions | |
CommunicationKDP (const char *comm_name) | |
~CommunicationKDP () override | |
bool | SendRequestPacket (const PacketStreamType &request_packet) |
size_t | WaitForPacketWithTimeoutMicroSeconds (lldb_private::DataExtractor &response, uint32_t usec) |
bool | GetSequenceMutex (std::unique_lock< std::recursive_mutex > &lock) |
bool | CheckForPacket (const uint8_t *src, size_t src_len, lldb_private::DataExtractor &packet) |
bool | IsRunning () const |
std::chrono::seconds | SetPacketTimeout (std::chrono::seconds packet_timeout) |
std::chrono::seconds | GetPacketTimeout () const |
bool | SendRequestConnect (uint16_t reply_port, uint16_t exc_port, const char *greeting) |
bool | SendRequestReattach (uint16_t reply_port) |
bool | SendRequestDisconnect () |
uint32_t | SendRequestReadMemory (lldb::addr_t addr, void *dst, uint32_t dst_size, lldb_private::Status &error) |
uint32_t | SendRequestWriteMemory (lldb::addr_t addr, const void *src, uint32_t src_len, lldb_private::Status &error) |
bool | SendRawRequest (uint8_t command_byte, const void *src, uint32_t src_len, lldb_private::DataExtractor &reply, lldb_private::Status &error) |
uint32_t | SendRequestReadRegisters (uint32_t cpu, uint32_t flavor, void *dst, uint32_t dst_size, lldb_private::Status &error) |
uint32_t | SendRequestWriteRegisters (uint32_t cpu, uint32_t flavor, const void *src, uint32_t src_size, lldb_private::Status &error) |
const char * | GetKernelVersion () |
uint32_t | GetVersion () |
uint32_t | GetFeatureFlags () |
bool | LocalBreakpointsAreSupported () |
uint32_t | GetCPUMask () |
uint32_t | GetCPUType () |
uint32_t | GetCPUSubtype () |
lldb_private::UUID | GetUUID () |
bool | RemoteIsEFI () |
bool | RemoteIsDarwinKernel () |
lldb::addr_t | GetLoadAddress () |
bool | SendRequestResume () |
bool | SendRequestSuspend () |
bool | SendRequestBreakpoint (bool set, lldb::addr_t addr) |
Public Member Functions inherited from lldb_private::Communication | |
Communication () | |
Construct the Communication object. | |
virtual | ~Communication () |
Destructor. | |
virtual void | Clear () |
lldb::ConnectionStatus | Connect (const char *url, Status *error_ptr) |
Connect using the current connection by passing url to its connect function. | |
virtual lldb::ConnectionStatus | Disconnect (Status *error_ptr=nullptr) |
Disconnect the communications connection if one is currently connected. | |
bool | IsConnected () const |
Check if the connection is valid. | |
bool | HasConnection () const |
lldb_private::Connection * | GetConnection () |
virtual size_t | Read (void *dst, size_t dst_len, const Timeout< std::micro > &timeout, lldb::ConnectionStatus &status, Status *error_ptr) |
Read bytes from the current connection. | |
size_t | Write (const void *src, size_t src_len, lldb::ConnectionStatus &status, Status *error_ptr) |
The actual write function that attempts to write to the communications protocol. | |
size_t | WriteAll (const void *src, size_t src_len, lldb::ConnectionStatus &status, Status *error_ptr) |
Repeatedly attempt writing until either src_len bytes are written or a permanent failure occurs. | |
virtual void | SetConnection (std::unique_ptr< Connection > connection) |
Sets the connection that it to be used by this class. | |
bool | GetCloseOnEOF () const |
void | SetCloseOnEOF (bool b) |
Static Public Attributes | |
static const uint32_t | kMaxPacketSize = 1200 |
static const uint32_t | kMaxDataSize = 1024 |
Protected Member Functions | |
bool | SendRequestPacketNoLock (const PacketStreamType &request_packet) |
size_t | WaitForPacketWithTimeoutMicroSecondsNoLock (lldb_private::DataExtractor &response, uint32_t timeout_usec) |
bool | WaitForNotRunningPrivate (const std::chrono::microseconds &timeout) |
void | MakeRequestPacketHeader (CommandType request_type, PacketStreamType &request_packet, uint16_t request_length) |
bool | SendRequestVersion () |
bool | SendRequestHostInfo () |
bool | SendRequestKernelVersion () |
void | DumpPacket (lldb_private::Stream &s, const void *data, uint32_t data_len) |
void | DumpPacket (lldb_private::Stream &s, const lldb_private::DataExtractor &extractor) |
bool | VersionIsValid () const |
bool | HostInfoIsValid () const |
bool | ExtractIsReply (uint8_t first_packet_byte) const |
CommandType | ExtractCommand (uint8_t first_packet_byte) const |
void | ClearKDPSettings () |
bool | SendRequestAndGetReply (const CommandType command, const PacketStreamType &request_packet, lldb_private::DataExtractor &reply_packet) |
Protected Member Functions inherited from lldb_private::Communication | |
size_t | ReadFromConnection (void *dst, size_t dst_len, const Timeout< std::micro > &timeout, lldb::ConnectionStatus &status, Status *error_ptr) |
Static Protected Member Functions | |
static const char * | GetCommandAsCString (uint8_t command) |
Protected Attributes | |
uint32_t | m_addr_byte_size |
lldb::ByteOrder | m_byte_order |
std::string | m_bytes |
std::recursive_mutex | m_bytes_mutex |
std::chrono::seconds | m_packet_timeout |
std::recursive_mutex | m_sequence_mutex |
lldb_private::Predicate< bool > | m_is_running |
uint32_t | m_session_key |
uint8_t | m_request_sequence_id |
uint8_t | m_exception_sequence_id |
uint32_t | m_kdp_version_version |
uint32_t | m_kdp_version_feature |
uint32_t | m_kdp_hostinfo_cpu_mask |
uint32_t | m_kdp_hostinfo_cpu_type |
uint32_t | m_kdp_hostinfo_cpu_subtype |
std::string | m_kernel_version |
lldb::addr_t | m_last_read_memory_addr |
Protected Attributes inherited from lldb_private::Communication | |
lldb::ConnectionSP | m_connection_sp |
The connection that is current in use by this communications class. | |
std::mutex | m_write_mutex |
Don't let multiple threads write at the same time... | |
bool | m_close_on_eof |
Private Member Functions | |
CommunicationKDP (const CommunicationKDP &)=delete | |
const CommunicationKDP & | operator= (const CommunicationKDP &)=delete |
Additional Inherited Members | |
Static Public Member Functions inherited from lldb_private::Communication | |
static std::string | ConnectionStatusAsString (lldb::ConnectionStatus status) |
Definition at line 22 of file CommunicationKDP.h.
typedef lldb_private::StreamBuffer<4096> CommunicationKDP::PacketStreamType |
Definition at line 26 of file CommunicationKDP.h.
anonymous enum |
Enumerator | |
---|---|
KDP_FEATURE_BP |
Definition at line 62 of file CommunicationKDP.h.
Definition at line 27 of file CommunicationKDP.h.
Enumerator | |
---|---|
KDP_PROTERR_SUCCESS | |
KDP_PROTERR_ALREADY_CONNECTED | |
KDP_PROTERR_BAD_NBYTES | |
KDP_PROTERR_BADFLAVOR |
Definition at line 64 of file CommunicationKDP.h.
Enumerator | |
---|---|
ePacketTypeRequest | |
ePacketTypeReply | |
ePacketTypeMask | |
eCommandTypeMask |
Definition at line 71 of file CommunicationKDP.h.
CommunicationKDP::CommunicationKDP | ( | const char * | comm_name | ) |
Definition at line 31 of file CommunicationKDP.cpp.
|
override |
Definition at line 40 of file CommunicationKDP.cpp.
References lldb_private::Communication::Disconnect(), and lldb_private::Communication::IsConnected().
|
privatedelete |
bool CommunicationKDP::CheckForPacket | ( | const uint8_t * | src, |
size_t | src_len, | ||
lldb_private::DataExtractor & | packet | ||
) |
Definition at line 229 of file CommunicationKDP.cpp.
References lldb_private::DataExtractor::Clear(), lldb_private::DumpHexBytes(), DumpPacket(), lldb_private::Stream::eBinary, lldb_private::eBroadcastAlways, ePacketTypeReply, ePacketTypeRequest, lldb_private::StreamBuffer< N >::GetData(), lldb_private::GetLog(), lldb_private::StreamBuffer< N >::GetSize(), lldb_private::DataExtractor::GetU16(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU8(), lldb_private::Log::GetVerbose(), KDP_BREAKPOINT_REMOVE, KDP_BREAKPOINT_REMOVE64, KDP_BREAKPOINT_SET, KDP_BREAKPOINT_SET64, KDP_CONNECT, KDP_DISCONNECT, KDP_DUMPINFO, KDP_EXCEPTION, KDP_HOSTINFO, KDP_HOSTREBOOT, KDP_IMAGEPATH, KDP_KERNELVERSION, KDP_LOAD, KDP_MAXBYTES, KDP_READIOPORT, KDP_READMEM, KDP_READMEM64, KDP_READMSR64, KDP_READPHYSMEM64, KDP_READREGS, KDP_REATTACH, KDP_REGIONS, KDP_RESUMECPUS, KDP_SUSPEND, KDP_TERMINATION, KDP_VERSION, KDP_WRITEIOPORT, KDP_WRITEMEM, KDP_WRITEMEM64, KDP_WRITEMSR64, KDP_WRITEPHYSMEM64, KDP_WRITEREGS, LLDB_INVALID_ADDRESS, LLDB_LOGF, m_addr_byte_size, m_byte_order, m_bytes, m_bytes_mutex, m_is_running, lldb_private::Stream::PutChar(), lldb_private::Stream::PutHex16(), lldb_private::Stream::PutHex32(), lldb_private::Stream::PutHex8(), SendRequestPacketNoLock(), lldb_private::DataExtractor::SetData(), lldb_private::Predicate< T >::SetValue(), and UINT32_MAX.
Referenced by WaitForPacketWithTimeoutMicroSecondsNoLock().
|
protected |
Definition at line 357 of file CommunicationKDP.cpp.
References m_kdp_hostinfo_cpu_mask, m_kdp_hostinfo_cpu_subtype, m_kdp_hostinfo_cpu_type, m_kdp_version_feature, m_kdp_version_version, and m_request_sequence_id.
Referenced by SendRequestDisconnect(), and SendRequestReattach().
|
protected |
Definition at line 722 of file CommunicationKDP.cpp.
References lldb_private::DumpDataExtractor(), lldb_private::DumpHexBytes(), lldb::eFormatBytes, lldb::eFormatBytesWithASCII, lldb::eFormatHex, error(), ExtractCommand(), ExtractIsReply(), lldb_private::DataExtractor::GetAddress(), lldb_private::DataExtractor::GetByteSize(), GetCommandAsCString(), lldb_private::DataExtractor::GetCStr(), lldb_private::DataExtractor::GetData(), lldb_private::GetPermissionsAsCString(), lldb_private::DataExtractor::GetU16(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64(), lldb_private::DataExtractor::GetU8(), IsRunning(), KDP_BREAKPOINT_REMOVE, KDP_BREAKPOINT_REMOVE64, KDP_BREAKPOINT_SET, KDP_BREAKPOINT_SET64, KDP_CONNECT, KDP_DISCONNECT, KDP_DUMPINFO, KDP_EXCEPTION, KDP_HOSTINFO, KDP_HOSTREBOOT, KDP_IMAGEPATH, KDP_KERNELVERSION, KDP_LOAD, KDP_MAXBYTES, KDP_READIOPORT, KDP_READMEM, KDP_READMEM64, KDP_READMSR64, KDP_READPHYSMEM64, KDP_READREGS, KDP_REATTACH, KDP_REGIONS, KDP_RESUMECPUS, KDP_SUSPEND, KDP_TERMINATION, KDP_VERSION, KDP_WRITEIOPORT, KDP_WRITEMEM, KDP_WRITEMEM64, KDP_WRITEMSR64, KDP_WRITEPHYSMEM64, KDP_WRITEREGS, LLDB_INVALID_ADDRESS, m_addr_byte_size, m_last_read_memory_addr, lldb_private::DataExtractor::PeekCStr(), lldb_private::Stream::Printf(), lldb_private::Stream::PutCString(), and UINT32_MAX.
|
protected |
Definition at line 716 of file CommunicationKDP.cpp.
References DumpPacket(), m_addr_byte_size, and m_byte_order.
Referenced by CheckForPacket(), DumpPacket(), SendRequestAndGetReply(), and SendRequestPacketNoLock().
|
inlineprotected |
Definition at line 209 of file CommunicationKDP.h.
References eCommandTypeMask.
Referenced by DumpPacket().
|
inlineprotected |
Definition at line 204 of file CommunicationKDP.h.
References ePacketTypeMask.
Referenced by DumpPacket().
|
staticprotected |
Definition at line 646 of file CommunicationKDP.cpp.
References KDP_BREAKPOINT_REMOVE, KDP_BREAKPOINT_REMOVE64, KDP_BREAKPOINT_SET, KDP_BREAKPOINT_SET64, KDP_CONNECT, KDP_DISCONNECT, KDP_DUMPINFO, KDP_EXCEPTION, KDP_HOSTINFO, KDP_HOSTREBOOT, KDP_IMAGEPATH, KDP_KERNELVERSION, KDP_LOAD, KDP_MAXBYTES, KDP_READIOPORT, KDP_READMEM, KDP_READMEM64, KDP_READMSR64, KDP_READPHYSMEM64, KDP_READREGS, KDP_REATTACH, KDP_REGIONS, KDP_RESUMECPUS, KDP_SUSPEND, KDP_TERMINATION, KDP_VERSION, KDP_WRITEIOPORT, KDP_WRITEMEM, KDP_WRITEMEM64, KDP_WRITEMSR64, KDP_WRITEPHYSMEM64, and KDP_WRITEREGS.
Referenced by DumpPacket().
uint32_t CommunicationKDP::GetCPUMask | ( | ) |
Definition at line 416 of file CommunicationKDP.cpp.
References HostInfoIsValid(), m_kdp_hostinfo_cpu_mask, and SendRequestHostInfo().
Referenced by SendRequestResume().
uint32_t CommunicationKDP::GetCPUSubtype | ( | ) |
Definition at line 428 of file CommunicationKDP.cpp.
References HostInfoIsValid(), m_kdp_hostinfo_cpu_subtype, and SendRequestHostInfo().
Referenced by ProcessKDP::GetHostArchitecture().
uint32_t CommunicationKDP::GetCPUType | ( | ) |
Definition at line 422 of file CommunicationKDP.cpp.
References HostInfoIsValid(), m_kdp_hostinfo_cpu_type, and SendRequestHostInfo().
Referenced by ThreadKDP::CreateRegisterContextForFrame(), and ProcessKDP::GetHostArchitecture().
uint32_t CommunicationKDP::GetFeatureFlags | ( | ) |
Definition at line 394 of file CommunicationKDP.cpp.
References m_kdp_version_feature, SendRequestVersion(), and VersionIsValid().
Referenced by LocalBreakpointsAreSupported().
const char * CommunicationKDP::GetKernelVersion | ( | ) |
Definition at line 510 of file CommunicationKDP.cpp.
References m_kernel_version, and SendRequestKernelVersion().
Referenced by ProcessKDP::DoConnectRemote(), GetLoadAddress(), GetUUID(), RemoteIsDarwinKernel(), and RemoteIsEFI().
lldb::addr_t CommunicationKDP::GetLoadAddress | ( | ) |
Definition at line 467 of file CommunicationKDP.cpp.
References GetKernelVersion(), LLDB_INVALID_ADDRESS, and m_kernel_version.
Referenced by ProcessKDP::DoConnectRemote().
|
inline |
Definition at line 107 of file CommunicationKDP.h.
References m_packet_timeout.
Referenced by SendRequestAndGetReply().
bool CommunicationKDP::GetSequenceMutex | ( | std::unique_lock< std::recursive_mutex > & | lock | ) |
Definition at line 157 of file CommunicationKDP.cpp.
References m_sequence_mutex.
lldb_private::UUID CommunicationKDP::GetUUID | ( | ) |
Definition at line 434 of file CommunicationKDP.cpp.
References GetKernelVersion(), m_kernel_version, and lldb_private::UUID::SetFromStringRef().
Referenced by ProcessKDP::DoConnectRemote().
uint32_t CommunicationKDP::GetVersion | ( | ) |
Definition at line 388 of file CommunicationKDP.cpp.
References m_kdp_version_version, SendRequestVersion(), and VersionIsValid().
Referenced by ProcessKDP::DoConnectRemote(), SendRequestBreakpoint(), SendRequestReadMemory(), and SendRequestWriteMemory().
|
inlineprotected |
Definition at line 202 of file CommunicationKDP.h.
References m_kdp_hostinfo_cpu_type.
Referenced by GetCPUMask(), GetCPUSubtype(), and GetCPUType().
|
inline |
Definition at line 93 of file CommunicationKDP.h.
References lldb_private::Predicate< T >::GetValue(), and m_is_running.
Referenced by ProcessKDP::DisableBreakpointSite(), ProcessKDP::DoDetach(), ProcessKDP::DoHalt(), DumpPacket(), and SendRequestAndGetReply().
|
inline |
Definition at line 147 of file CommunicationKDP.h.
References GetFeatureFlags(), and KDP_FEATURE_BP.
Referenced by ProcessKDP::DisableBreakpointSite(), and ProcessKDP::EnableBreakpointSite().
|
protected |
Definition at line 52 of file CommunicationKDP.cpp.
References lldb_private::StreamBuffer< N >::Clear(), ePacketTypeRequest, m_request_sequence_id, m_session_key, lldb_private::Stream::PutHex16(), lldb_private::Stream::PutHex32(), and lldb_private::Stream::PutHex8().
Referenced by SendRawRequest(), SendRequestBreakpoint(), SendRequestConnect(), SendRequestDisconnect(), SendRequestHostInfo(), SendRequestKernelVersion(), SendRequestReadMemory(), SendRequestReadRegisters(), SendRequestReattach(), SendRequestResume(), SendRequestSuspend(), SendRequestVersion(), SendRequestWriteMemory(), and SendRequestWriteRegisters().
|
privatedelete |
bool CommunicationKDP::RemoteIsDarwinKernel | ( | ) |
Definition at line 461 of file CommunicationKDP.cpp.
References GetKernelVersion(), and m_kernel_version.
Referenced by ProcessKDP::DoConnectRemote().
bool CommunicationKDP::RemoteIsEFI | ( | ) |
Definition at line 455 of file CommunicationKDP.cpp.
References GetKernelVersion(), and m_kernel_version.
Referenced by ProcessKDP::DoConnectRemote().
bool CommunicationKDP::SendRawRequest | ( | uint8_t | command_byte, |
const void * | src, | ||
uint32_t | src_len, | ||
lldb_private::DataExtractor & | reply, | ||
lldb_private::Status & | error | ||
) |
Definition at line 617 of file CommunicationKDP.cpp.
References lldb_private::Stream::eBinary, error(), lldb_private::Status::FromErrorString(), lldb_private::Status::FromErrorStringWithFormat(), lldb_private::DataExtractor::GetU32(), KDP_DUMPINFO, m_addr_byte_size, m_byte_order, MakeRequestPacketHeader(), lldb_private::Stream::PutRawBytes(), and SendRequestAndGetReply().
Referenced by CommandObjectProcessKDPPacketSend::DoExecute().
|
protected |
Definition at line 64 of file CommunicationKDP.cpp.
References lldb_private::DataExtractor::Clear(), DumpPacket(), lldb_private::eBroadcastAlways, eCommandTypeMask, lldb_private::StreamBuffer< N >::GetData(), lldb_private::GetLog(), GetPacketTimeout(), lldb_private::StreamBuffer< N >::GetSize(), lldb_private::DataExtractor::GetU8(), IsRunning(), KDP_RESUMECPUS, LLDB_LOGF, m_is_running, m_sequence_mutex, SendRequestPacketNoLock(), lldb_private::Predicate< T >::SetValue(), and WaitForPacketWithTimeoutMicroSecondsNoLock().
Referenced by SendRawRequest(), SendRequestBreakpoint(), SendRequestConnect(), SendRequestDisconnect(), SendRequestHostInfo(), SendRequestKernelVersion(), SendRequestReadMemory(), SendRequestReadRegisters(), SendRequestReattach(), SendRequestResume(), SendRequestSuspend(), SendRequestVersion(), SendRequestWriteMemory(), and SendRequestWriteRegisters().
bool CommunicationKDP::SendRequestBreakpoint | ( | bool | set, |
lldb::addr_t | addr | ||
) |
Definition at line 1250 of file CommunicationKDP.cpp.
References lldb_private::Stream::eBinary, lldb_private::DataExtractor::GetU32(), GetVersion(), KDP_BREAKPOINT_REMOVE, KDP_BREAKPOINT_REMOVE64, KDP_BREAKPOINT_SET, KDP_BREAKPOINT_SET64, m_addr_byte_size, m_byte_order, MakeRequestPacketHeader(), lldb_private::Stream::PutMaxHex64(), and SendRequestAndGetReply().
Referenced by ProcessKDP::DisableBreakpointSite(), and ProcessKDP::EnableBreakpointSite().
bool CommunicationKDP::SendRequestConnect | ( | uint16_t | reply_port, |
uint16_t | exc_port, | ||
const char * | greeting | ||
) |
Definition at line 334 of file CommunicationKDP.cpp.
References lldb_private::Stream::eBinary, lldb::eByteOrderLittle, KDP_CONNECT, m_addr_byte_size, m_byte_order, MakeRequestPacketHeader(), lldb_private::Stream::PutCString(), lldb_private::Stream::PutHex16(), SendRequestAndGetReply(), and lldb_private::Stream::SetByteOrder().
Referenced by ProcessKDP::DoConnectRemote().
bool CommunicationKDP::SendRequestDisconnect | ( | ) |
Definition at line 532 of file CommunicationKDP.cpp.
References ClearKDPSettings(), lldb_private::Stream::eBinary, KDP_DISCONNECT, m_addr_byte_size, m_byte_order, MakeRequestPacketHeader(), and SendRequestAndGetReply().
Referenced by ProcessKDP::DoDetach().
|
protected |
Definition at line 486 of file CommunicationKDP.cpp.
References lldb_private::eArchTypeMachO, lldb_private::Stream::eBinary, lldb_private::ArchSpec::GetAddressByteSize(), lldb_private::ArchSpec::GetByteOrder(), lldb_private::DataExtractor::GetU32(), KDP_HOSTINFO, m_addr_byte_size, m_byte_order, m_kdp_hostinfo_cpu_mask, m_kdp_hostinfo_cpu_subtype, m_kdp_hostinfo_cpu_type, MakeRequestPacketHeader(), SendRequestAndGetReply(), and lldb_private::ArchSpec::SetArchitecture().
Referenced by GetCPUMask(), GetCPUSubtype(), and GetCPUType().
|
protected |
Definition at line 516 of file CommunicationKDP.cpp.
References lldb_private::Stream::eBinary, KDP_KERNELVERSION, m_addr_byte_size, m_byte_order, m_kernel_version, MakeRequestPacketHeader(), lldb_private::DataExtractor::PeekCStr(), and SendRequestAndGetReply().
Referenced by GetKernelVersion().
bool CommunicationKDP::SendRequestPacket | ( | const PacketStreamType & | request_packet | ) |
Definition at line 46 of file CommunicationKDP.cpp.
References m_sequence_mutex, and SendRequestPacketNoLock().
|
protected |
Definition at line 130 of file CommunicationKDP.cpp.
References DumpPacket(), lldb::eConnectionStatusSuccess, lldb_private::StreamBuffer< N >::GetData(), lldb_private::GetLog(), lldb_private::StreamBuffer< N >::GetSize(), lldb_private::Communication::IsConnected(), LLDB_LOGF, and lldb_private::Communication::Write().
Referenced by CheckForPacket(), SendRequestAndGetReply(), and SendRequestPacket().
uint32_t CommunicationKDP::SendRequestReadMemory | ( | lldb::addr_t | addr, |
void * | dst, | ||
uint32_t | dst_size, | ||
lldb_private::Status & | error | ||
) |
Definition at line 546 of file CommunicationKDP.cpp.
References lldb_private::Stream::eBinary, error(), lldb_private::Status::FromErrorString(), lldb_private::Status::FromErrorStringWithFormat(), lldb_private::DataExtractor::GetByteSize(), lldb_private::DataExtractor::GetData(), lldb_private::DataExtractor::GetU32(), GetVersion(), KDP_READMEM, KDP_READMEM64, m_addr_byte_size, m_byte_order, MakeRequestPacketHeader(), lldb_private::Stream::PutHex32(), lldb_private::Stream::PutMaxHex64(), and SendRequestAndGetReply().
Referenced by ProcessKDP::DoReadMemory().
uint32_t CommunicationKDP::SendRequestReadRegisters | ( | uint32_t | cpu, |
uint32_t | flavor, | ||
void * | dst, | ||
uint32_t | dst_size, | ||
lldb_private::Status & | error | ||
) |
Definition at line 1167 of file CommunicationKDP.cpp.
References lldb_private::Stream::eBinary, error(), lldb_private::Status::FromErrorString(), lldb_private::Status::FromErrorStringWithFormat(), lldb_private::DataExtractor::GetByteSize(), lldb_private::DataExtractor::GetData(), lldb_private::DataExtractor::GetU32(), KDP_READREGS, m_addr_byte_size, m_byte_order, MakeRequestPacketHeader(), lldb_private::Stream::PutHex32(), and SendRequestAndGetReply().
Referenced by RegisterContextKDP_arm::DoReadDBG(), RegisterContextKDP_arm64::DoReadDBG(), RegisterContextKDP_arm::DoReadEXC(), RegisterContextKDP_arm64::DoReadEXC(), RegisterContextKDP_i386::DoReadEXC(), RegisterContextKDP_x86_64::DoReadEXC(), RegisterContextKDP_arm::DoReadFPU(), RegisterContextKDP_arm64::DoReadFPU(), RegisterContextKDP_i386::DoReadFPU(), RegisterContextKDP_x86_64::DoReadFPU(), RegisterContextKDP_arm::DoReadGPR(), RegisterContextKDP_arm64::DoReadGPR(), RegisterContextKDP_i386::DoReadGPR(), and RegisterContextKDP_x86_64::DoReadGPR().
bool CommunicationKDP::SendRequestReattach | ( | uint16_t | reply_port | ) |
Definition at line 366 of file CommunicationKDP.cpp.
References ClearKDPSettings(), lldb_private::Stream::eBinary, lldb::eByteOrderLittle, lldb_private::DataExtractor::GetU32(), KDP_REATTACH, m_addr_byte_size, m_byte_order, m_session_key, MakeRequestPacketHeader(), lldb_private::Stream::PutHex16(), SendRequestAndGetReply(), and lldb_private::Stream::SetByteOrder().
Referenced by ProcessKDP::DoConnectRemote().
bool CommunicationKDP::SendRequestResume | ( | ) |
Definition at line 1238 of file CommunicationKDP.cpp.
References lldb_private::Stream::eBinary, GetCPUMask(), KDP_RESUMECPUS, m_addr_byte_size, m_byte_order, MakeRequestPacketHeader(), lldb_private::Stream::PutHex32(), and SendRequestAndGetReply().
Referenced by ProcessKDP::DoResume().
bool CommunicationKDP::SendRequestSuspend | ( | ) |
Definition at line 1273 of file CommunicationKDP.cpp.
References lldb_private::Stream::eBinary, KDP_SUSPEND, m_addr_byte_size, m_byte_order, MakeRequestPacketHeader(), and SendRequestAndGetReply().
|
protected |
Definition at line 400 of file CommunicationKDP.cpp.
References lldb_private::Stream::eBinary, lldb_private::DataExtractor::GetU32(), KDP_VERSION, m_addr_byte_size, m_byte_order, m_kdp_version_feature, m_kdp_version_version, MakeRequestPacketHeader(), and SendRequestAndGetReply().
Referenced by GetFeatureFlags(), and GetVersion().
uint32_t CommunicationKDP::SendRequestWriteMemory | ( | lldb::addr_t | addr, |
const void * | src, | ||
uint32_t | src_len, | ||
lldb_private::Status & | error | ||
) |
Definition at line 584 of file CommunicationKDP.cpp.
References lldb_private::Stream::eBinary, error(), lldb_private::Status::FromErrorString(), lldb_private::Status::FromErrorStringWithFormat(), lldb_private::DataExtractor::GetU32(), GetVersion(), KDP_WRITEMEM, KDP_WRITEMEM64, m_addr_byte_size, m_byte_order, MakeRequestPacketHeader(), lldb_private::Stream::PutHex32(), lldb_private::Stream::PutMaxHex64(), lldb_private::Stream::PutRawBytes(), and SendRequestAndGetReply().
Referenced by ProcessKDP::DoWriteMemory().
uint32_t CommunicationKDP::SendRequestWriteRegisters | ( | uint32_t | cpu, |
uint32_t | flavor, | ||
const void * | src, | ||
uint32_t | src_size, | ||
lldb_private::Status & | error | ||
) |
Definition at line 1209 of file CommunicationKDP.cpp.
References lldb_private::Stream::eBinary, error(), lldb_private::Status::FromErrorString(), lldb_private::Status::FromErrorStringWithFormat(), lldb_private::DataExtractor::GetU32(), KDP_WRITEREGS, m_addr_byte_size, m_byte_order, MakeRequestPacketHeader(), lldb_private::Stream::PutHex32(), SendRequestAndGetReply(), and lldb_private::Stream::Write().
Referenced by RegisterContextKDP_arm::DoWriteDBG(), RegisterContextKDP_arm64::DoWriteDBG(), RegisterContextKDP_arm::DoWriteEXC(), RegisterContextKDP_arm64::DoWriteEXC(), RegisterContextKDP_i386::DoWriteEXC(), RegisterContextKDP_x86_64::DoWriteEXC(), RegisterContextKDP_arm::DoWriteFPU(), RegisterContextKDP_arm64::DoWriteFPU(), RegisterContextKDP_i386::DoWriteFPU(), RegisterContextKDP_x86_64::DoWriteFPU(), RegisterContextKDP_arm::DoWriteGPR(), RegisterContextKDP_arm64::DoWriteGPR(), RegisterContextKDP_i386::DoWriteGPR(), and RegisterContextKDP_x86_64::DoWriteGPR().
|
inline |
Definition at line 101 of file CommunicationKDP.h.
References m_packet_timeout.
Referenced by ProcessKDP::ProcessKDP().
|
inlineprotected |
Definition at line 200 of file CommunicationKDP.h.
References m_kdp_version_version.
Referenced by GetFeatureFlags(), and GetVersion().
|
protected |
Definition at line 164 of file CommunicationKDP.cpp.
References m_is_running, and lldb_private::Predicate< T >::WaitForValueEqualTo().
size_t CommunicationKDP::WaitForPacketWithTimeoutMicroSeconds | ( | lldb_private::DataExtractor & | response, |
uint32_t | usec | ||
) |
Definition at line 170 of file CommunicationKDP.cpp.
References m_sequence_mutex, and WaitForPacketWithTimeoutMicroSecondsNoLock().
Referenced by ProcessKDP::AsyncThread().
|
protected |
Definition at line 176 of file CommunicationKDP.cpp.
References CheckForPacket(), lldb_private::DataExtractor::Clear(), lldb_private::Communication::ConnectionStatusAsString(), lldb_private::Communication::Disconnect(), lldb::eConnectionStatusEndOfFile, lldb::eConnectionStatusError, lldb::eConnectionStatusInterrupted, lldb::eConnectionStatusLostConnection, lldb::eConnectionStatusNoConnection, lldb::eConnectionStatusSuccess, lldb::eConnectionStatusTimedOut, error(), lldb_private::DataExtractor::GetByteSize(), lldb_private::GetLog(), lldb_private::Communication::IsConnected(), LLDB_LOGV, lldb_private::Communication::Read(), and UINT32_MAX.
Referenced by SendRequestAndGetReply(), and WaitForPacketWithTimeoutMicroSeconds().
|
static |
Definition at line 25 of file CommunicationKDP.h.
|
static |
Definition at line 24 of file CommunicationKDP.h.
|
protected |
Definition at line 222 of file CommunicationKDP.h.
Referenced by CheckForPacket(), DumpPacket(), SendRawRequest(), SendRequestBreakpoint(), SendRequestConnect(), SendRequestDisconnect(), SendRequestHostInfo(), SendRequestKernelVersion(), SendRequestReadMemory(), SendRequestReadRegisters(), SendRequestReattach(), SendRequestResume(), SendRequestSuspend(), SendRequestVersion(), SendRequestWriteMemory(), and SendRequestWriteRegisters().
|
protected |
Definition at line 223 of file CommunicationKDP.h.
Referenced by CheckForPacket(), DumpPacket(), SendRawRequest(), SendRequestBreakpoint(), SendRequestConnect(), SendRequestDisconnect(), SendRequestHostInfo(), SendRequestKernelVersion(), SendRequestReadMemory(), SendRequestReadRegisters(), SendRequestReattach(), SendRequestResume(), SendRequestSuspend(), SendRequestVersion(), SendRequestWriteMemory(), and SendRequestWriteRegisters().
|
protected |
Definition at line 224 of file CommunicationKDP.h.
Referenced by CheckForPacket().
|
protected |
Definition at line 225 of file CommunicationKDP.h.
Referenced by CheckForPacket().
|
protected |
Definition at line 232 of file CommunicationKDP.h.
|
protected |
Definition at line 229 of file CommunicationKDP.h.
Referenced by CheckForPacket(), IsRunning(), SendRequestAndGetReply(), and WaitForNotRunningPrivate().
|
protected |
Definition at line 235 of file CommunicationKDP.h.
Referenced by ClearKDPSettings(), GetCPUMask(), and SendRequestHostInfo().
|
protected |
Definition at line 237 of file CommunicationKDP.h.
Referenced by ClearKDPSettings(), GetCPUSubtype(), and SendRequestHostInfo().
|
protected |
Definition at line 236 of file CommunicationKDP.h.
Referenced by ClearKDPSettings(), GetCPUType(), HostInfoIsValid(), and SendRequestHostInfo().
|
protected |
Definition at line 234 of file CommunicationKDP.h.
Referenced by ClearKDPSettings(), GetFeatureFlags(), and SendRequestVersion().
|
protected |
Definition at line 233 of file CommunicationKDP.h.
Referenced by ClearKDPSettings(), GetVersion(), SendRequestVersion(), and VersionIsValid().
|
protected |
Definition at line 238 of file CommunicationKDP.h.
Referenced by GetKernelVersion(), GetLoadAddress(), GetUUID(), RemoteIsDarwinKernel(), RemoteIsEFI(), and SendRequestKernelVersion().
|
protected |
Definition at line 241 of file CommunicationKDP.h.
Referenced by DumpPacket().
|
protected |
Definition at line 226 of file CommunicationKDP.h.
Referenced by GetPacketTimeout(), and SetPacketTimeout().
|
protected |
Definition at line 231 of file CommunicationKDP.h.
Referenced by ClearKDPSettings(), and MakeRequestPacketHeader().
|
protected |
Definition at line 227 of file CommunicationKDP.h.
Referenced by GetSequenceMutex(), SendRequestAndGetReply(), SendRequestPacket(), and WaitForPacketWithTimeoutMicroSeconds().
|
protected |
Definition at line 230 of file CommunicationKDP.h.
Referenced by MakeRequestPacketHeader(), and SendRequestReattach().