LLDB mainline
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
StringExtractor Class Reference

#include <StringExtractor.h>

Inheritance diagram for StringExtractor:
Inheritance graph
[legend]

Public Types

enum  { BigEndian = 0 , LittleEndian = 1 }
 

Public Member Functions

 StringExtractor ()
 
 StringExtractor (llvm::StringRef packet_str)
 
 StringExtractor (const char *packet_cstr)
 
virtual ~StringExtractor ()
 
void Reset (llvm::StringRef str)
 
bool IsGood () const
 
uint64_t GetFilePos () const
 
void SetFilePos (uint32_t idx)
 
void Clear ()
 
void SkipSpaces ()
 
llvm::StringRef GetStringRef () const
 
bool Empty ()
 
size_t GetBytesLeft ()
 
char GetChar (char fail_value='\0')
 
char PeekChar (char fail_value='\0')
 
int DecodeHexU8 ()
 
uint8_t GetHexU8 (uint8_t fail_value=0, bool set_eof_on_fail=true)
 
bool GetHexU8Ex (uint8_t &ch, bool set_eof_on_fail=true)
 
bool GetNameColonValue (llvm::StringRef &name, llvm::StringRef &value)
 
int32_t GetS32 (int32_t fail_value, int base=0)
 
uint32_t GetU32 (uint32_t fail_value, int base=0)
 
int64_t GetS64 (int64_t fail_value, int base=0)
 
uint64_t GetU64 (uint64_t fail_value, int base=0)
 
uint32_t GetHexMaxU32 (bool little_endian, uint32_t fail_value)
 
uint64_t GetHexMaxU64 (bool little_endian, uint64_t fail_value)
 
size_t GetHexBytes (llvm::MutableArrayRef< uint8_t > dest, uint8_t fail_fill_value)
 
size_t GetHexBytesAvail (llvm::MutableArrayRef< uint8_t > dest)
 
size_t GetHexByteString (std::string &str)
 
size_t GetHexByteStringFixedLength (std::string &str, uint32_t nibble_length)
 
size_t GetHexByteStringTerminatedBy (std::string &str, char terminator)
 
bool ConsumeFront (const llvm::StringRef &str)
 
const char * Peek ()
 

Protected Member Functions

bool fail ()
 

Protected Attributes

std::string m_packet
 The string in which to extract data.
 
uint64_t m_index = 0
 When extracting data from a packet, this index will march along as things get extracted.
 

Detailed Description

Definition at line 19 of file StringExtractor.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
BigEndian 
LittleEndian 

Definition at line 21 of file StringExtractor.h.

Constructor & Destructor Documentation

◆ StringExtractor() [1/3]

StringExtractor::StringExtractor ( )

Definition at line 29 of file StringExtractor.cpp.

◆ StringExtractor() [2/3]

StringExtractor::StringExtractor ( llvm::StringRef  packet_str)

Definition at line 31 of file StringExtractor.cpp.

References m_packet.

◆ StringExtractor() [3/3]

StringExtractor::StringExtractor ( const char *  packet_cstr)

Definition at line 35 of file StringExtractor.cpp.

References m_packet.

◆ ~StringExtractor()

StringExtractor::~StringExtractor ( )
virtualdefault

Member Function Documentation

◆ Clear()

void StringExtractor::Clear ( )
inline

◆ ConsumeFront()

bool StringExtractor::ConsumeFront ( const llvm::StringRef &  str)

◆ DecodeHexU8()

int StringExtractor::DecodeHexU8 ( )

Definition at line 58 of file StringExtractor.cpp.

References GetBytesLeft(), m_index, m_packet, SkipSpaces(), and xdigit_to_sint().

Referenced by GetHexBytesAvail(), and GetHexU8Ex().

◆ Empty()

bool StringExtractor::Empty ( )
inline

◆ fail()

bool StringExtractor::fail ( )
inlineprotected

Definition at line 107 of file StringExtractor.h.

References m_index, and UINT64_MAX.

Referenced by GetNameColonValue().

◆ GetBytesLeft()

size_t StringExtractor::GetBytesLeft ( )
inline

Definition at line 52 of file StringExtractor.h.

References m_index, and m_packet.

Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::AsyncThread(), DecodeHexU8(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoReadMemory(), StringExtractorGDBRemote::GetEscapedBinaryData(), GetHexBytes(), GetHexByteString(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::GetThreadFromSuffix(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle__M(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle__m(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_A(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_C(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_c(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_D(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_H(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_M(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_memory_read(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_P(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QEnvironment(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QEnvironmentHexEncoded(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qFileLoadAddress(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QLaunchArch(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qMemoryRegionInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qMemTags(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QMemTags(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QPassSignals(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QRestoreRegisterState(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qWatchpointSupportInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vAttach(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vAttachOrWait(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vAttachWait(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vCont(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_Z(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_z(), ParseMemoryRegionInfoFromProcMapsLine(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::ReadMemoryTags(), and lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo().

◆ GetChar()

char StringExtractor::GetChar ( char  fail_value = '\0')

Definition at line 43 of file StringExtractor.cpp.

References m_index, m_packet, and UINT64_MAX.

Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::AsyncThread(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::AutoCompleteDiskFileOrDirectory(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::CalculateMD5(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::CreateSymlink(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::FStat(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetCurrentProcessAndThreadIDs(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetCurrentProcessID(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetDefaultThreadId(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetFileExists(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetFilePermissions(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetFileSize(), StringExtractorGDBRemote::GetStatus(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::GetThreadFromSuffix(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle__M(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_A(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_D(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_H(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_M(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_memory_read(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_P(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qfProcessInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qMemTags(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QMemTags(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qModuleInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QPassSignals(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::Handle_qPathComplete(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qPlatform_chmod(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qPlatform_mkdir(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qPlatform_shell(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qWatchpointSupportInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qXfer(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vAttach(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vAttachOrWait(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vAttachWait(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vCont(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Open(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_pRead(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_pWrite(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_symlink(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_Z(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_z(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::KillProcess(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::LaunchProcess(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::MakeDirectory(), ParseHostIOPacketResponse(), ParseMemoryRegionInfoFromProcMapsLine(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::ReadFile(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::ReadMemoryTags(), lldb_private::process_gdb_remote::GDBRemoteClientBase::ReadPacketWithOutputSupport(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::RunShellCommand(), lldb_private::process_gdb_remote::GDBRemoteClientBase::SendContinuePacketAndWaitForResponse(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetFilePermissions(), lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::Unlink(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::WriteFile().

◆ GetFilePos()

uint64_t StringExtractor::GetFilePos ( ) const
inline

◆ GetHexBytes()

size_t StringExtractor::GetHexBytes ( llvm::MutableArrayRef< uint8_t >  dest,
uint8_t  fail_fill_value 
)

◆ GetHexBytesAvail()

size_t StringExtractor::GetHexBytesAvail ( llvm::MutableArrayRef< uint8_t >  dest)

◆ GetHexByteString()

size_t StringExtractor::GetHexByteString ( std::string &  str)

Definition at line 298 of file StringExtractor.cpp.

References GetBytesLeft(), and GetHexU8().

Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::AsyncThread(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::DecodeProcessInfoResponse(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetCurrentProcessInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetGroupName(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetHostInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetMemoryRegionInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetModuleInfo(), StringExtractorGDBRemote::GetStatus(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetUserName(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetWorkingDir(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QEnvironmentHexEncoded(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qFileLoadAddress(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qfProcessInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qModuleInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::Handle_qPathComplete(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qPlatform_chmod(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qPlatform_mkdir(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qPlatform_shell(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qSaveCore(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QSetSTDERR(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QSetSTDIN(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QSetSTDOUT(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QSetWorkingDir(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::Handle_QSetWorkingDir(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vAttachOrWait(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vAttachWait(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Exists(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_MD5(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Mode(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Size(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_symlink(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_unlink(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vRun(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::LaunchGDBServer(), lldb_private::process_gdb_remote::GDBRemoteClientBase::ReadPacketWithOutputSupport(), lldb_private::process_gdb_remote::ProcessGDBRemote::SaveCore(), lldb_private::process_gdb_remote::GDBRemoteClientBase::SendContinuePacketAndWaitForResponse(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::ServeSymbolLookups(), and lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo().

◆ GetHexByteStringFixedLength()

size_t StringExtractor::GetHexByteStringFixedLength ( std::string &  str,
uint32_t  nibble_length 
)

◆ GetHexByteStringTerminatedBy()

size_t StringExtractor::GetHexByteStringTerminatedBy ( std::string &  str,
char  terminator 
)

◆ GetHexMaxU32()

uint32_t StringExtractor::GetHexMaxU32 ( bool  little_endian,
uint32_t  fail_value 
)

Definition at line 153 of file StringExtractor.cpp.

References m_index, m_packet, SkipSpaces(), UINT64_MAX, and xdigit_to_sint().

Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::CreateSymlink(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_C(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_p(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_P(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::Handle_qPathComplete(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qPlatform_chmod(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qPlatform_mkdir(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qRegisterInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vCont(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Open(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_pRead(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_pWrite(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_Z(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::MakeDirectory(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::RunShellCommand(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetFilePermissions(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::Unlink().

◆ GetHexMaxU64()

uint64_t StringExtractor::GetHexMaxU64 ( bool  little_endian,
uint64_t  fail_value 
)

Definition at line 204 of file StringExtractor.cpp.

References m_index, m_packet, SkipSpaces(), UINT64_MAX, and xdigit_to_sint().

Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::AllocateMemory(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetCurrentProcessID(), lldb_private::process_gdb_remote::ProcessGDBRemote::GetFileLoadAddress(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetFileSize(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetRemoteQSupported(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetShlibInfoAddr(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::GetThreadFromSuffix(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle__M(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle__m(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_M(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_memory_read(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qMemoryRegionInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qMemTags(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QMemTags(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qThreadStopInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qXfer(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_pRead(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_Z(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_z(), lldb_private::process_gdb_remote::ProcessGDBRemote::HarmonizeThreadIdsForProfileData(), and ParseMemoryRegionInfoFromProcMapsLine().

◆ GetHexU8()

uint8_t StringExtractor::GetHexU8 ( uint8_t  fail_value = 0,
bool  set_eof_on_fail = true 
)

◆ GetHexU8Ex()

bool StringExtractor::GetHexU8Ex ( uint8_t &  ch,
bool  set_eof_on_fail = true 
)

Definition at line 81 of file StringExtractor.cpp.

References DecodeHexU8(), m_index, m_packet, and UINT64_MAX.

Referenced by GetHexU8().

◆ GetNameColonValue()

bool StringExtractor::GetNameColonValue ( llvm::StringRef &  name,
llvm::StringRef &  value 
)

◆ GetS32()

int32_t StringExtractor::GetS32 ( int32_t  fail_value,
int  base = 0 
)

◆ GetS64()

int64_t StringExtractor::GetS64 ( int64_t  fail_value,
int  base = 0 
)

◆ GetStringRef()

llvm::StringRef StringExtractor::GetStringRef ( ) const
inline

Definition at line 48 of file StringExtractor.h.

References m_packet.

Referenced by ASCIIHexBytesResponseValidator(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::CalculateMD5(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::ConfigureRemoteStructuredData(), ConsumeFront(), CommandObjectProcessGDBRemotePacketSend::DoExecute(), CommandObjectProcessKDPPacketSend::DoExecute(), CommandObjectProcessGDBRemotePacketMonitor::DoExecute(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoReadMemory(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoWriteMemory(), lldb_private::process_gdb_remote::ProcessGDBRemote::FlashDone(), lldb_private::process_gdb_remote::ProcessGDBRemote::FlashErase(), lldb_private::process_gdb_remote::ProcessGDBRemote::GetDynamicLoaderProcessState(), lldb_private::process_gdb_remote::ProcessGDBRemote::GetExtendedInfoForThread(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetGroupName(), lldb_private::process_gdb_remote::ProcessGDBRemote::GetLoadedDynamicLibrariesInfos_sender(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetModulesInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::GetPacketAndSendResponse(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetQOffsets(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetRemoteQSupported(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::GetRemoteUnixSignals(), lldb_private::process_gdb_remote::ProcessGDBRemote::GetSharedCacheInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetSupportedStructuredDataPlugins(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::GetThreadFromSuffix(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetThreadsInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetUserName(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetVContSupported(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_C(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_c(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_p(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_P(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qEcho(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QNonStop(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qSaveCore(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qSupported(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qThreadStopInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qXfer(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vRun(), JSONResponseValidator(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::KillProcess(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::LaunchProcess(), lldb_private::process_gdb_remote::ProcessGDBRemote::ParseExpeditedRegisters(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::QueryGDBServer(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::ReadAllRegisters(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::ReadExtFeature(), lldb_private::process_gdb_remote::GDBRemoteCommunication::ReadPacket(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::ReadRegister(), lldb_private::process_gdb_remote::ProcessGDBRemote::SaveCore(), lldb_private::process_gdb_remote::GDBRemoteClientBase::SendContinuePacketAndWaitForResponse(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServer::SendIllFormedResponse(), lldb_private::process_gdb_remote::GDBRemoteClientBase::SendPacketAndWaitForResponseNoLock(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::ServeSymbolLookups(), lldb_private::process_gdb_remote::ProcessGDBRemote::SetLastStopPacket(), lldb_private::process_gdb_remote::ProcessGDBRemote::UpdateThreadIDList(), and lldb_private::process_gdb_remote::GDBRemoteCommunication::WaitForPacketNoLock().

◆ GetU32()

uint32_t StringExtractor::GetU32 ( uint32_t  fail_value,
int  base = 0 
)

◆ GetU64()

uint64_t StringExtractor::GetU64 ( uint64_t  fail_value,
int  base = 0 
)

◆ IsGood()

bool StringExtractor::IsGood ( ) const
inline

Definition at line 35 of file StringExtractor.h.

References m_index, and UINT64_MAX.

Referenced by GetHexBytes().

◆ Peek()

const char * StringExtractor::Peek ( )
inline

Definition at line 100 of file StringExtractor.h.

References m_index, and m_packet.

Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::AutoCompleteDiskFileOrDirectory(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::CalculateMD5(), GetHexByteStringFixedLength(), GetHexByteStringTerminatedBy(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::GetThreadFromSuffix(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_C(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_c(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_jLLDBTraceGetBinaryData(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_jLLDBTraceGetState(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_jLLDBTraceStart(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_jLLDBTraceStop(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_jModulesInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QEnvironment(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QLaunchArch(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qMemTags(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QMemTags(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vCont(), ParseMemoryRegionInfoFromProcMapsLine(), PeekChar(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::ReadFile(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendTraceGetState(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendTraceSupported().

◆ PeekChar()

char StringExtractor::PeekChar ( char  fail_value = '\0')
inline

◆ Reset()

void StringExtractor::Reset ( llvm::StringRef  str)
inline

Definition at line 28 of file StringExtractor.h.

References m_index, and m_packet.

◆ SetFilePos()

void StringExtractor::SetFilePos ( uint32_t  idx)
inline

Definition at line 39 of file StringExtractor.h.

References m_index.

Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::AsyncThread(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::CalculateMD5(), lldb_private::process_gdb_remote::GDBRemoteCommunication::CheckForPacket(), StringExtractorGDBRemote::GetError(), StringExtractorGDBRemote::GetStatus(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::GetThreadFromSuffix(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle__M(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle__m(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_A(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_C(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_c(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_D(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_g(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_H(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_I(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_jModulesInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_M(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_memory_read(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_p(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_P(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QEnvironment(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QEnvironmentHexEncoded(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qFileLoadAddress(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qfProcessInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qGroupName(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::Handle_qKillSpawnedProcess(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QLaunchArch(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::Handle_qLaunchGDBServer(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qMemoryRegionInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qMemTags(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QMemTags(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qModuleInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QPassSignals(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::Handle_qPathComplete(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qPlatform_chmod(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qPlatform_mkdir(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qPlatform_shell(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qProcessInfoPID(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qRegisterInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QRestoreRegisterState(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QSaveRegisterState(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QSetDetachOnError(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QSetDisableASLR(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QSetSTDERR(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QSetSTDIN(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QSetSTDOUT(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QSetWorkingDir(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::Handle_QSetWorkingDir(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qSpeedTest(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qThreadStopInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qUserName(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qWatchpointSupportInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_T(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vAttach(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vAttachOrWait(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vAttachWait(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vCont(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Close(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Exists(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_FStat(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_MD5(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Mode(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Open(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_pRead(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_pWrite(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Size(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_symlink(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_unlink(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vKill(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_Z(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_z(), lldb_private::process_gdb_remote::ProcessGDBRemote::HarmonizeThreadIdsForProfileData(), ParseHostIOPacketResponse(), lldb_private::process_gdb_remote::GDBRemoteClientBase::SendContinuePacketAndWaitForResponse(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::ServeSymbolLookups(), and lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo().

◆ SkipSpaces()

void StringExtractor::SkipSpaces ( )

Member Data Documentation

◆ m_index

uint64_t StringExtractor::m_index = 0
protected

When extracting data from a packet, this index will march along as things get extracted.

If set to UINT64_MAX the end of the packet data was reached when decoding information.

Definition at line 118 of file StringExtractor.h.

Referenced by Clear(), ConsumeFront(), DecodeHexU8(), fail(), GetBytesLeft(), GetChar(), StringExtractorGDBRemote::GetEscapedBinaryData(), GetFilePos(), GetHexMaxU32(), GetHexMaxU64(), GetHexU8Ex(), GetNameColonValue(), StringExtractorGDBRemote::GetPidTid(), GetS32(), GetS64(), GetU32(), GetU64(), IsGood(), Peek(), Reset(), SetFilePos(), and SkipSpaces().

◆ m_packet

std::string StringExtractor::m_packet
protected

The documentation for this class was generated from the following files: