#include <GdbPacket.h>

Public Member Functions

 GdbPacket ()
 
 ~GdbPacket ()
 
void writeChar (char c)
 
void writeCharEscaped (char c)
 Send a character, escaping if required. More...
 
void writeEscaped (const void *data, unsigned length)
 Send a block of data, escaping as required. More...
 
void writeHexByte (uint8_t value)
 Output 8-bit value. More...
 
void writeHexWord16 (uint16_t value)
 Output 16-bit value. More...
 
void writeHexWord32 (uint32_t value)
 Output 32-bit value. More...
 
void writeHexBlock (const void *src, size_t size)
 Output a block of data, hex-encoded. More...
 
void writeX32 ()
 Output 'xxxxxxxx' to indicate undefined register value. More...
 
void write (const void *data, unsigned length)
 Output block of data exactly as given without escaping. More...
 
void writeStr (const char *str)
 Output a null-terminated string exactly as given without escaping. More...
 
void writeStrRef (const char *str)
 Output a string reference in addr/len format. More...
 
size_t getLength ()
 

Static Public Member Functions

static uint32_t readHexValue (const char *&data)
 Decode a variable-length hex value, MSB first. More...
 
static void encodeHexBlock (char *dst, const void *src, size_t size)
 Encode a value as hex characters, LSB first. More...
 
static size_t decodeHexBlock (void *dst, const char *&src)
 Decode hex-encoded data block. More...
 

Constructor & Destructor Documentation

◆ GdbPacket()

GdbPacket::GdbPacket ( )
inline

◆ ~GdbPacket()

GdbPacket::~GdbPacket ( )
inline

Member Function Documentation

◆ decodeHexBlock()

static size_t GdbPacket::decodeHexBlock ( void *  dst,
const char *&  src 
)
static

Decode hex-encoded data block.

Parameters
dstbuffer for decoded hex bytes (may be same as src)
srcsource data, on return points to first character after hex data
Return values
size_tnumber of decoded bytes
Note
Output is always smaller than input so safe to overwrite src

◆ encodeHexBlock()

static void GdbPacket::encodeHexBlock ( char *  dst,
const void *  src,
size_t  size 
)
static

Encode a value as hex characters, LSB first.

Parameters
dstLocation for output, will NOT be nul-terminated
srcData bytes to encode
sizeSize of source data in bytes
Note
destination buffer must have enough space for (size * 2) chars

◆ getLength()

size_t GdbPacket::getLength ( )
inline

◆ readHexValue()

static uint32_t GdbPacket::readHexValue ( const char *&  data)
static

Decode a variable-length hex value, MSB first.

Parameters
datawill get positioned on the end of the hex string, as far as the routine has read into it
Return values
uint32_tdecoded value

◆ write()

void GdbPacket::write ( const void *  data,
unsigned  length 
)

Output block of data exactly as given without escaping.

◆ writeChar()

void GdbPacket::writeChar ( char  c)

◆ writeCharEscaped()

void GdbPacket::writeCharEscaped ( char  c)

Send a character, escaping if required.

◆ writeEscaped()

void GdbPacket::writeEscaped ( const void *  data,
unsigned  length 
)

Send a block of data, escaping as required.

◆ writeHexBlock()

void GdbPacket::writeHexBlock ( const void *  src,
size_t  size 
)

Output a block of data, hex-encoded.

Parameters
src
size

◆ writeHexByte()

void GdbPacket::writeHexByte ( uint8_t  value)

Output 8-bit value.

◆ writeHexWord16()

void GdbPacket::writeHexWord16 ( uint16_t  value)

Output 16-bit value.

◆ writeHexWord32()

void GdbPacket::writeHexWord32 ( uint32_t  value)

Output 32-bit value.

◆ writeStr()

void GdbPacket::writeStr ( const char *  str)

Output a null-terminated string exactly as given without escaping.

◆ writeStrRef()

void GdbPacket::writeStrRef ( const char *  str)

Output a string reference in addr/len format.

◆ writeX32()

void GdbPacket::writeX32 ( )

Output 'xxxxxxxx' to indicate undefined register value.


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