summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libs/qtcreatorcdbext/symbolgroupnode.cpp5
-rw-r--r--src/libs/qtcreatorcdbext/symbolgroupvalue.cpp26
-rw-r--r--tests/auto/debugger/tst_dumpers.cpp3
3 files changed, 15 insertions, 19 deletions
diff --git a/src/libs/qtcreatorcdbext/symbolgroupnode.cpp b/src/libs/qtcreatorcdbext/symbolgroupnode.cpp
index f036c54c0c..e72cb4872a 100644
--- a/src/libs/qtcreatorcdbext/symbolgroupnode.cpp
+++ b/src/libs/qtcreatorcdbext/symbolgroupnode.cpp
@@ -1159,6 +1159,11 @@ int SymbolGroupNode::dumpNode(std::ostream &str,
? DumpEncodingJulianDateAndMillisecondsSinceMidnight
: DumpEncodingMillisecondsSinceEpoch;
break;
+ case KT_QTimeZone: // Based on a QByteArray dumper
+ case KT_QByteArray:
+ if (QtInfo::get(ctx).version > 4)
+ encoding = DumpEncodingHex_Latin1_WithQuotes;
+ break;
}
if (encoding) {
str << ",valueencoded=\"" << encoding << "\",value=\"" << gdbmiWStringFormat(value) <<'"';
diff --git a/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp b/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp
index 55666678aa..1d14bc1c2f 100644
--- a/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp
+++ b/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp
@@ -1728,6 +1728,8 @@ static inline bool dumpQByteArray(const SymbolGroupValue &v, std::wostream &str,
}
// Qt 5: Data start at offset past the 'd' of type QByteArrayData.
+ wchar_t oldFill = str.fill(wchar_t('0'));
+ str << std::hex;
char *memory;
unsigned fullSize;
unsigned size;
@@ -1735,26 +1737,20 @@ static inline bool dumpQByteArray(const SymbolGroupValue &v, std::wostream &str,
if (!readQt5StringData(dV, qtInfo, false, 0, maxStringSize, &fullSize, &size, &memory))
return false;
if (size) {
- // Emulate CDB's behavior of replacing unprintable characters
- // by dots.
- std::wstring display;
- display.reserve(size);
char *memEnd = memory + size;
for (char *p = memory; p < memEnd; p++) {
- const char c = *p;
- display.push_back(c >= 0 && isprint(c) ? wchar_t(c) : L'.');
+ const unsigned char c = *p;
+ str << std::setw(2) << c;
}
- str << "\"" << display;
if (fullSize > size)
- str << L"...";
- str << L'"';
- } else {
- str << L"\"\"";
+ str << L"2e2e2e"; // ...
}
if (memoryHandle)
*memoryHandle = new MemoryHandle(reinterpret_cast<unsigned char *>(memory), size);
else
delete [] memory;
+ str << std::dec;
+ str.fill(oldFill);
return true;
}
@@ -2230,12 +2226,8 @@ static bool dumpQDateTime(const SymbolGroupValue &v, std::wostream &str)
str << msecs << separator
<< spec << separator
<< offset << separator
- << std::hex;
- if (timeZoneString.length() > 2) {
- for (unsigned i = 1; i < timeZoneString.length() - 1; ++i) // remove '"'
- str << (int)timeZoneString.at(i);
- }
- str << std::dec << separator << status;
+ << timeZoneString << separator
+ << status;
return true;
}
diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp
index 6117c31b28..9bfb8a4563 100644
--- a/tests/auto/debugger/tst_dumpers.cpp
+++ b/tests/auto/debugger/tst_dumpers.cpp
@@ -1539,8 +1539,7 @@ void tst_Dumpers::dumper_data()
+ Check("ba0", "ba0", "\"\"", "@QByteArray")
+ Check("ba1", QByteArray("\"Hello\"World")
- + char(0) + char(1) + char(2) + '"', "@QByteArray") % NoCdbEngine
- + Check("ba1", QByteArray("\"Hello\"World...\""), "@QByteArray") % CdbEngine
+ + char(0) + char(1) + char(2) + '"', "@QByteArray")
+ Check("ba1.0", "[0]", "72", "char")
+ Check("ba1.11", "[11]", "0", "char")
+ Check("ba1.12", "[12]", "1", "char")