|
ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
|
Functions | |
| uint8_t | fromHex (char c) |
| convert a character to the hex value it represents(0-15) | |
| char | toHex (uint8_t l) |
| converts the lower 4 bits to a representing char | |
| uint8_t | toByte (char h, char l) |
| converts 2 hex characters to a byte | |
| uint8_t | toByte (std::string hex, size_t pos=0) |
| converts 2 characters from a hex string to one byte | |
| std::string | fromByte (uint8_t byte) |
| converts a byte to a hex string (without "0x" prefix); | |
| void | fromByte (std::string &append, uint8_t byte) |
| converts a byte to hexadecimal representation and appends it to the passed string | |
| std::string | fromBytes (uint8_t *buf, size_t length) |
| converts a sequence of bytes to a representing hex string (without "0x" prefix) | |
| 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 | |
| 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. | |
| template<typename INT > | |
| INT | tryInt (std::string &string, unsigned &pos, size_t maxlength=sizeof(INT) *2) |
| parses a hex string and returns the result. | |
|
extern |
|
extern |
converts a byte to a hex string (without "0x" prefix);
| byte |
Definition at line 62 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 76 of file Hex.cpp.
References length(), and toHex().
Referenced by etiss::plugin::gdb::Server::handlePacket().


|
extern |
convert a character to the hex value it represents(0-15)
| c | hex repesentation 0-9,a-f,A-F |
Definition at line 18 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 93 of file Hex.h.
References fromByte(), and uint8_t.
Referenced by etiss::plugin::gdb::Server::handlePacket().


|
extern |
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 57 of file Hex.cpp.
References fromHex(), and uint8_t.
Referenced by etiss::plugin::gdb::Server::handlePacket(), toByte(), toInt(), and etiss::plugin::gdb::PacketProtocol::tryReadPacket().


|
extern |
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 37 of file Hex.cpp.
Referenced by fromByte(), 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 125 of file Hex.h.
References fromHex(), length(), and uint8_t.
