forked from qt-creator/qt-creator
Debugger: Use hex instead of base64 encoding for CDB debuggee output
Simplifies code. Change-Id: Iaabb4b32f7b351d04b512cc132f990a1061da3b5 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -104,7 +104,7 @@ STDMETHODIMP OutputCallback::Output(
|
||||
}
|
||||
// Base encode as GDBMI is not really made for wide chars
|
||||
std::ostringstream str;
|
||||
base64Encode(str, reinterpret_cast<const unsigned char *>(text), sizeof(wchar_t) * std::wcslen(text));
|
||||
hexEncode(str, reinterpret_cast<const unsigned char *>(text), sizeof(wchar_t) * std::wcslen(text));
|
||||
ExtensionContext::instance().reportLong('E', 0, "debuggee_output", str.str().c_str());
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -2237,7 +2237,9 @@ void CdbEngine::handleExtensionMessage(char t, int token, const QByteArray &what
|
||||
}
|
||||
|
||||
if (what == "debuggee_output") {
|
||||
showMessage(StringFromBase64EncodedUtf16(message), AppOutput);
|
||||
const QByteArray decoded = QByteArray::fromHex(message);
|
||||
showMessage(QString::fromUtf16(reinterpret_cast<const ushort *>(decoded.data()), decoded.size() / 2),
|
||||
AppOutput);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -352,14 +352,6 @@ QString debugByteArray(const QByteArray &a)
|
||||
return rc;
|
||||
}
|
||||
|
||||
QString StringFromBase64EncodedUtf16(const QByteArray &a)
|
||||
{
|
||||
QByteArray utf16 = QByteArray::fromBase64(a);
|
||||
utf16.append('\0');
|
||||
utf16.append('\0');
|
||||
return QString::fromUtf16(reinterpret_cast<const unsigned short *>(utf16.constData()));
|
||||
}
|
||||
|
||||
WinException::WinException() :
|
||||
exceptionCode(0), exceptionFlags(0), exceptionAddress(0),
|
||||
info1(0),info2(0), firstChance(false), lineNumber(0)
|
||||
|
||||
@@ -78,7 +78,6 @@ void parseBreakPoint(const GdbMi &gdbmi, BreakpointResponse *r, QString *express
|
||||
QByteArray cdbWriteMemoryCommand(quint64 addr, const QByteArray &data);
|
||||
|
||||
QString debugByteArray(const QByteArray &a);
|
||||
QString StringFromBase64EncodedUtf16(const QByteArray &a);
|
||||
|
||||
DisassemblerLines parseCdbDisassembler(const QByteArray &a);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user