Commit 2dac5e64 authored by hjk's avatar hjk
Browse files

Fixes: debugger: display quotes around strings in locals view

parent 0ac615a1
......@@ -555,7 +555,7 @@ void QDumper::addCommaIfNeeded()
put(',');
}
void QDumper::putBase64Encoded(const char *buf, int n)
void QDumper::putBase64Encoded(const char *buf, int n, char delim)
{
const char alphabet[] = "ABCDEFGH" "IJKLMNOP" "QRSTUVWX" "YZabcdef"
"ghijklmn" "opqrstuv" "wxyz0123" "456789+/";
......
......@@ -2761,14 +2761,17 @@ static void setWatchDataValue(WatchData &data, const GdbMi &mi,
break;
case 1: // base64 encoded 8 bit data
ba = QByteArray::fromBase64(mi.data());
ba = '"' + ba + '"';
break;
case 2: // base64 encoded 16 bit data
ba = QByteArray::fromBase64(mi.data());
ba = QString::fromUtf16((ushort *)ba.data(), ba.size() / 2).toUtf8();
ba = '"' + ba + '"';
break;
case 3: // base64 encoded 32 bit data
ba = QByteArray::fromBase64(mi.data());
ba = QString::fromUcs4((uint *)ba.data(), ba.size() / 4).toUtf8();
ba = '"' + ba + '"';
break;
}
data.setValue(ba);
......@@ -3550,14 +3553,10 @@ void GdbEngine::handleDumpCustomValue2(const GdbResultRecord &record,
data1.iname = data.iname + "." + data1.name;
if (!data1.name.isEmpty() && data1.name.at(0).isDigit())
data1.name = '[' + data1.name + ']';
//qDebug() << "NAMEENCODED: " << item.findChild("nameencoded").data()
// << item.findChild("nameencoded").data()[1];
if (item.findChild("nameencoded").data()[0] == '1')
data1.name = QByteArray::fromBase64(data1.name.toUtf8());
QString key = item.findChild("key").data();
if (!key.isEmpty()) {
if (item.findChild("keyencoded").data()[0] == '1')
key = QByteArray::fromBase64(key.toUtf8());
key = '"' + QByteArray::fromBase64(key.toUtf8()) + '"';
data1.name += " (" + key + ")";
}
setWatchDataType(data1, item.findChild("type"));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment