forked from qt-creator/qt-creator
Debugger[New CDB]: Work on recoding char *-pointers.
Latin1/Ucs4. Append hex dump in case non-printable characters show in default output.
This commit is contained in:
@@ -234,6 +234,23 @@ std::wstring dataToHexW(const unsigned char *p, const unsigned char *end)
|
||||
return rc;
|
||||
}
|
||||
|
||||
// Readable hex: '0xAA 0xBB'..
|
||||
std::wstring dataToReadableHexW(const unsigned char *begin, const unsigned char *end)
|
||||
{
|
||||
if (begin == end)
|
||||
return std::wstring();
|
||||
|
||||
std::wstring rc;
|
||||
rc.reserve(5 * (end - begin));
|
||||
for (const unsigned char *p = begin; p < end ; p++) {
|
||||
rc.append(p == begin ? L"0x" : L" 0x");
|
||||
const unsigned c = *p;
|
||||
rc.push_back(toHexDigit(c / 16));
|
||||
rc.push_back(toHexDigit(c &0xF));
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
// Format a map as a GDBMI hash {key="value",..}
|
||||
void formatGdbmiHash(std::ostream &os, const std::map<std::string, std::string> &m)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user