LLDB mainline
Public Member Functions | Private Member Functions | Private Attributes | List of all members
lldb_private::process_gdb_remote::GDBRemoteCommunicationHistory Class Reference

The history keeps a circular buffer of GDB remote packets. More...

#include <GDBRemoteCommunicationHistory.h>

Public Member Functions

 GDBRemoteCommunicationHistory (uint32_t size=0)
 
 ~GDBRemoteCommunicationHistory ()
 
void AddPacket (char packet_char, GDBRemotePacket::Type type, uint32_t bytes_transmitted)
 
void AddPacket (const std::string &src, uint32_t src_len, GDBRemotePacket::Type type, uint32_t bytes_transmitted)
 
void Dump (Stream &strm) const
 
void Dump (Log *log) const
 
bool DidDumpToLog () const
 

Private Member Functions

uint32_t GetFirstSavedPacketIndex () const
 
uint32_t GetNumPacketsInHistory () const
 
uint32_t GetNextIndex ()
 
uint32_t NormalizeIndex (uint32_t i) const
 

Private Attributes

std::vector< GDBRemotePacketm_packets
 
uint32_t m_curr_idx = 0
 
uint32_t m_total_packet_count = 0
 
bool m_dumped_to_log = false
 

Detailed Description

The history keeps a circular buffer of GDB remote packets.

The history is used for logging and replaying GDB remote packets.

Definition at line 24 of file GDBRemoteCommunicationHistory.h.

Constructor & Destructor Documentation

◆ GDBRemoteCommunicationHistory()

GDBRemoteCommunicationHistory::GDBRemoteCommunicationHistory ( uint32_t  size = 0)

Definition at line 20 of file GDBRemoteCommunicationHistory.cpp.

References m_packets.

◆ ~GDBRemoteCommunicationHistory()

GDBRemoteCommunicationHistory::~GDBRemoteCommunicationHistory ( )
default

Member Function Documentation

◆ AddPacket() [1/2]

void GDBRemoteCommunicationHistory::AddPacket ( char  packet_char,
GDBRemotePacket::Type  type,
uint32_t  bytes_transmitted 
)

◆ AddPacket() [2/2]

void GDBRemoteCommunicationHistory::AddPacket ( const std::string &  src,
uint32_t  src_len,
GDBRemotePacket::Type  type,
uint32_t  bytes_transmitted 
)

Definition at line 43 of file GDBRemoteCommunicationHistory.cpp.

References GetNextIndex(), m_packets, and m_total_packet_count.

◆ DidDumpToLog()

bool lldb_private::process_gdb_remote::GDBRemoteCommunicationHistory::DidDumpToLog ( ) const
inline

◆ Dump() [1/2]

void GDBRemoteCommunicationHistory::Dump ( Log log) const

◆ Dump() [2/2]

void GDBRemoteCommunicationHistory::Dump ( Stream strm) const

◆ GetFirstSavedPacketIndex()

uint32_t lldb_private::process_gdb_remote::GDBRemoteCommunicationHistory::GetFirstSavedPacketIndex ( ) const
inlineprivate

Definition at line 42 of file GDBRemoteCommunicationHistory.h.

References m_curr_idx, m_packets, and m_total_packet_count.

Referenced by Dump().

◆ GetNextIndex()

uint32_t lldb_private::process_gdb_remote::GDBRemoteCommunicationHistory::GetNextIndex ( )
inlineprivate

Definition at line 56 of file GDBRemoteCommunicationHistory.h.

References m_curr_idx, m_total_packet_count, and NormalizeIndex().

Referenced by AddPacket().

◆ GetNumPacketsInHistory()

uint32_t lldb_private::process_gdb_remote::GDBRemoteCommunicationHistory::GetNumPacketsInHistory ( ) const
inlineprivate

Definition at line 49 of file GDBRemoteCommunicationHistory.h.

References m_packets, and m_total_packet_count.

Referenced by Dump().

◆ NormalizeIndex()

uint32_t lldb_private::process_gdb_remote::GDBRemoteCommunicationHistory::NormalizeIndex ( uint32_t  i) const
inlineprivate

Definition at line 63 of file GDBRemoteCommunicationHistory.h.

References m_packets.

Referenced by Dump(), and GetNextIndex().

Member Data Documentation

◆ m_curr_idx

uint32_t lldb_private::process_gdb_remote::GDBRemoteCommunicationHistory::m_curr_idx = 0
private

Definition at line 68 of file GDBRemoteCommunicationHistory.h.

Referenced by Dump(), GetFirstSavedPacketIndex(), and GetNextIndex().

◆ m_dumped_to_log

bool lldb_private::process_gdb_remote::GDBRemoteCommunicationHistory::m_dumped_to_log = false
mutableprivate

Definition at line 70 of file GDBRemoteCommunicationHistory.h.

Referenced by DidDumpToLog(), and Dump().

◆ m_packets

std::vector<GDBRemotePacket> lldb_private::process_gdb_remote::GDBRemoteCommunicationHistory::m_packets
private

◆ m_total_packet_count

uint32_t lldb_private::process_gdb_remote::GDBRemoteCommunicationHistory::m_total_packet_count = 0
private

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