Commit 23d6a1a2 authored by hjk's avatar hjk

Debugger: Add dumper for QTimeZone

Change-Id: I1b20529d7ecdcbf5480e95d6e7be89a2fdb6a8b7
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 4a882905
......@@ -330,6 +330,10 @@ class DumperBase:
def putByteArrayValue(self, value):
return self.putValue(self.encodeByteArray(value), Hex2EncodedLatin1)
def putByteArrayValueByAddress(self, addr):
self.putValue(self.encodeByteArrayHelper(self.dereference(addr)),
Hex2EncodedLatin1)
def putStringValueByAddress(self, addr):
self.putValue(self.encodeStringHelper(self.dereference(addr)),
Hex4EncodedLittleEndian)
......
......@@ -231,6 +231,17 @@ def qdump__QTime(d, value):
d.putNumChild(0)
def qdump__QTimeZone(d, value):
base = d.dereferenceValue(value)
if d.isNull(base):
d.putValue("(null)")
d.putNumChild(0)
return
idAddr = base + 2 * d.ptrSize() # [QSharedData] + [vptr]
d.putByteArrayValueByAddress(idAddr)
d.putPlainChildren(value["d"])
def qdump__QDateTime(d, value):
qtVersion = d.qtVersion()
isValid = False
......
......@@ -1298,6 +1298,21 @@ void tst_Dumpers::dumper_data()
% Check("c", "'x' (120)", "@QChar").setForCdbOnly()
% Check("c", "120", "@QChar").setEngines(DumpTestGdbEngine | DumpTestLldbEngine);
QTest::newRow("QTimeZone0")
<< Data("#include <QTimeZone>\n",
"QTimeZone tz;\n"
"unused(&tz);\n")
% CoreProfile()
% Check("tz", "(null)", "@QTimeZone");
QTest::newRow("QTimeZone1")
<< Data("#include <QTimeZone>\n",
"QTimeZone tz(\"UTC+05:00\");\n"
"unused(&tz);\n")
% CoreProfile()
% Check("tz", "\"UTC+05:00\"", "@QTimeZone")
% Check("tz.d.m_name", "\"UTC+05:00\"", "@QString");
QTest::newRow("QDate0")
<< Data("#include <QDate>\n",
"QDate date;\n"
......
......@@ -168,6 +168,7 @@ void dummyStatement(...) {}
#include <QStandardItemModel>
#include <QTextCursor>
#include <QTextDocument>
#include <QTimeZone>
#endif
#if USE_SCRIPTLIB
......@@ -708,6 +709,14 @@ namespace undefined {
namespace qdatetime {
void testQTimeZone()
{
QTimeZone zz;
QTimeZone tz("UTC+05:00");
BREAK_HERE;
dummyStatement(&zz, &tz);
}
void testQDate()
{
QDate date;
......@@ -768,6 +777,7 @@ namespace qdatetime {
void testDateTime()
{
testQTimeZone();
testQDate();
testQDateTime();
testQTime();
......
Markdown is supported
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