forked from qt-creator/qt-creator
Fixes: debugger: fix dumping of QString used as hash key
This commit is contained in:
@@ -311,7 +311,7 @@ static bool isSimpleType(const char *type)
|
|||||||
|
|
||||||
static bool isShortKey(const char *type)
|
static bool isShortKey(const char *type)
|
||||||
{
|
{
|
||||||
return isSimpleType(type) || isEqual(type, "QString");
|
return isSimpleType(type) || isEqual(type, NS"QString");
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isMovableType(const char *type)
|
static bool isMovableType(const char *type)
|
||||||
@@ -704,44 +704,44 @@ static void qDumpUnknown(QDumper &d)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void qDumpInnerValueHelper(QDumper &d, const char *type, const void *addr,
|
static void qDumpInnerValueHelper(QDumper &d, const char *type, const void *addr,
|
||||||
const char *key = "value")
|
const char *field = "value")
|
||||||
{
|
{
|
||||||
type = stripNamespace(type);
|
type = stripNamespace(type);
|
||||||
switch (type[1]) {
|
switch (type[1]) {
|
||||||
case 'l':
|
case 'l':
|
||||||
if (isEqual(type, "float"))
|
if (isEqual(type, "float"))
|
||||||
P(d, key, *(float*)addr);
|
P(d, field, *(float*)addr);
|
||||||
return;
|
return;
|
||||||
case 'n':
|
case 'n':
|
||||||
if (isEqual(type, "int"))
|
if (isEqual(type, "int"))
|
||||||
P(d, key, *(int*)addr);
|
P(d, field, *(int*)addr);
|
||||||
else if (isEqual(type, "unsigned"))
|
else if (isEqual(type, "unsigned"))
|
||||||
P(d, key, *(unsigned int*)addr);
|
P(d, field, *(unsigned int*)addr);
|
||||||
else if (isEqual(type, "unsigned int"))
|
else if (isEqual(type, "unsigned int"))
|
||||||
P(d, key, *(unsigned int*)addr);
|
P(d, field, *(unsigned int*)addr);
|
||||||
else if (isEqual(type, "unsigned long"))
|
else if (isEqual(type, "unsigned long"))
|
||||||
P(d, key, *(unsigned long*)addr);
|
P(d, field, *(unsigned long*)addr);
|
||||||
else if (isEqual(type, "unsigned long long"))
|
else if (isEqual(type, "unsigned long long"))
|
||||||
P(d, key, *(qulonglong*)addr);
|
P(d, field, *(qulonglong*)addr);
|
||||||
return;
|
return;
|
||||||
case 'o':
|
case 'o':
|
||||||
if (isEqual(type, "bool"))
|
if (isEqual(type, "bool"))
|
||||||
switch (*(bool*)addr) {
|
switch (*(bool*)addr) {
|
||||||
case 0: P(d, key, "false"); break;
|
case 0: P(d, field, "false"); break;
|
||||||
case 1: P(d, key, "true"); break;
|
case 1: P(d, field, "true"); break;
|
||||||
default: P(d, key, *(bool*)addr); break;
|
default: P(d, field, *(bool*)addr); break;
|
||||||
}
|
}
|
||||||
else if (isEqual(type, "double"))
|
else if (isEqual(type, "double"))
|
||||||
P(d, key, *(double*)addr);
|
P(d, field, *(double*)addr);
|
||||||
else if (isEqual(type, "long"))
|
else if (isEqual(type, "long"))
|
||||||
P(d, key, *(long*)addr);
|
P(d, field, *(long*)addr);
|
||||||
else if (isEqual(type, "long long"))
|
else if (isEqual(type, "long long"))
|
||||||
P(d, key, *(qulonglong*)addr);
|
P(d, field, *(qulonglong*)addr);
|
||||||
return;
|
return;
|
||||||
case 'B':
|
case 'B':
|
||||||
if (isEqual(type, "QByteArray")) {
|
if (isEqual(type, "QByteArray")) {
|
||||||
d << key << "encoded=\"1\",";
|
d << field << "encoded=\"1\",";
|
||||||
P(d, key, *(QByteArray*)addr);
|
P(d, field, *(QByteArray*)addr);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case 'L':
|
case 'L':
|
||||||
@@ -769,8 +769,8 @@ static void qDumpInnerValueHelper(QDumper &d, const char *type, const void *addr
|
|||||||
return;
|
return;
|
||||||
case 'S':
|
case 'S':
|
||||||
if (isEqual(type, "QString")) {
|
if (isEqual(type, "QString")) {
|
||||||
d << key << "encoded=\"1\",";
|
d << field << "encoded=\"1\",";
|
||||||
P(d, key, *(QString*)addr);
|
P(d, field, *(QString*)addr);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
|
@@ -3555,8 +3555,11 @@ void GdbEngine::handleDumpCustomValue2(const GdbResultRecord &record,
|
|||||||
if (item.findChild("nameencoded").data()[0] == '1')
|
if (item.findChild("nameencoded").data()[0] == '1')
|
||||||
data1.name = QByteArray::fromBase64(data1.name.toUtf8());
|
data1.name = QByteArray::fromBase64(data1.name.toUtf8());
|
||||||
QString key = item.findChild("key").data();
|
QString key = item.findChild("key").data();
|
||||||
if (!key.isEmpty())
|
if (!key.isEmpty()) {
|
||||||
|
if (item.findChild("keyencoded").data()[0] == '1')
|
||||||
|
key = QByteArray::fromBase64(key.toUtf8());
|
||||||
data1.name += " (" + key + ")";
|
data1.name += " (" + key + ")";
|
||||||
|
}
|
||||||
setWatchDataType(data1, item.findChild("type"));
|
setWatchDataType(data1, item.findChild("type"));
|
||||||
setWatchDataExpression(data1, item.findChild("exp"));
|
setWatchDataExpression(data1, item.findChild("exp"));
|
||||||
setWatchDataChildCount(data1, item.findChild("numchild"));
|
setWatchDataChildCount(data1, item.findChild("numchild"));
|
||||||
|
Reference in New Issue
Block a user