Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
GdbPacket Class Reference

Public Member Functions

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...
 

Member Function Documentation

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
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
srcDataData bytes to encode
sizeSize of source data in bytes destination buffer must have enough space for (size * 2) chars
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
void GdbPacket::write ( const void *  data,
unsigned  length 
)

Output block of data exactly as given without escaping.

void GdbPacket::writeCharEscaped ( char  c)

Send a character, escaping if required.

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

Send a block of data, escaping as required.

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

Output a block of data, hex-encoded.

Parameters
src
size
void GdbPacket::writeHexByte ( uint8_t  value)

Output 8-bit value.

void GdbPacket::writeHexWord16 ( uint16_t  value)

Output 16-bit value.

void GdbPacket::writeHexWord32 ( uint32_t  value)

Output 32-bit value.

void GdbPacket::writeStr ( const char *  str)

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

void GdbPacket::writeStrRef ( const char *  str)

Output a string reference in addr/len format.

void GdbPacket::writeX32 ( )

Output 'xxxxxxxx' to indicate undefined register value.