ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
|
Functions | |
uint8_t | fromHex (char c) |
convert a character to the hex value it represents(0-15) More... | |
char | toHex (uint8_t l) |
converts the lower 4 bits to a representing char More... | |
uint8_t | toByte (char h, char l) |
converts 2 hex characters to a byte More... | |
uint8_t | toByte (std::string hex, size_t pos=0) |
converts 2 characters from a hex string to one byte More... | |
std::string | fromByte (uint8_t byte) |
converts a byte to a hex string (without "0x" prefix); More... | |
void | fromByte (std::string &append, uint8_t byte) |
converts a byte to hexadecimal representation and appends it to the passed string More... | |
std::string | fromBytes (uint8_t *buf, size_t length) |
converts a sequence of bytes to a representing hex string (without "0x" prefix) More... | |
template<typename INT > | |
void | fromInt (std::string &string, INT val, bool isLittleEndian) |
converts an integer type variable to a hexadecimal representation with the given endianness More... | |
template<typename INT > | |
INT | toInt (const std::string &string, bool isLittleEndian, size_t pos=0) |
convert a string of length (pos + sizeof(INT)) or larger to the represented value. More... | |
template<typename INT > | |
INT | tryInt (std::string &string, unsigned &pos, size_t maxlength=sizeof(INT) *2) |
parses a hex string and returns the result. More... | |
void etiss::plugin::gdb::hex::fromByte | ( | std::string & | append, |
uint8_t | byte | ||
) |
std::string etiss::plugin::gdb::hex::fromByte | ( | uint8_t | byte | ) |
converts a byte to a hex string (without "0x" prefix);
byte |
Definition at line 100 of file Hex.cpp.
References toHex().
Referenced by fromInt(), etiss::plugin::gdb::Server::handlePacket(), etiss::plugin::gdb::Server::postMemAccessCallback(), etiss::plugin::gdb::Server::preInstructionCallback(), and etiss::plugin::gdb::PacketProtocol::snd().
converts a sequence of bytes to a representing hex string (without "0x" prefix)
buf | |
length |
Definition at line 114 of file Hex.cpp.
References length(), and toHex().
Referenced by etiss::plugin::gdb::Server::handlePacket().
uint8_t etiss::plugin::gdb::hex::fromHex | ( | char | c | ) |
convert a character to the hex value it represents(0-15)
c | hex repesentation 0-9,a-f,A-F |
Definition at line 56 of file Hex.cpp.
Referenced by etiss::plugin::gdb::Server::handlePacket(), toByte(), and tryInt().
void etiss::plugin::gdb::hex::fromInt | ( | std::string & | string, |
INT | val, | ||
bool | isLittleEndian | ||
) |
converts an integer type variable to a hexadecimal representation with the given endianness
string | the string where hex characters will be appended |
val | interger value to convert |
isLittleEndian | true for little endian hex representaion, false for big endian |
Definition at line 131 of file Hex.h.
References fromByte(), and uint8_t.
Referenced by etiss::plugin::gdb::Server::handlePacket().
uint8_t etiss::plugin::gdb::hex::toByte | ( | char | h, |
char | l | ||
) |
converts 2 hex characters to a byte
h character representing higher 4 bits; may not be invalid
l character representing lower 4 bits; may not be invalid
Definition at line 95 of file Hex.cpp.
References fromHex(), and get_metrics::h.
Referenced by etiss::plugin::gdb::Server::handlePacket(), toByte(), toInt(), and etiss::plugin::gdb::PacketProtocol::tryReadPacket().
char etiss::plugin::gdb::hex::toHex | ( | uint8_t | l | ) |
converts the lower 4 bits to a representing char
l | whose lower 4 bits are used. higher bits may not be set |
Definition at line 75 of file Hex.cpp.
Referenced by fromByte(), and fromBytes().
INT etiss::plugin::gdb::hex::tryInt | ( | std::string & | string, |
unsigned & | pos, | ||
size_t | maxlength = sizeof(INT) * 2 |
||
) |
parses a hex string and returns the result.
the string will be parsed until the end is reached, an invalid character was encountered or maxlength was reached. this function cannot handle a "0x" prefix
string | string to parse; |
pos | current position in the string. will be set to the index of the first character that was not part of the returned value |
maxlength | maximum parse length in characters (may be uneven) |
Definition at line 163 of file Hex.h.
References fromHex(), length(), and uint8_t.