Commit 7d219d78 authored by hjk's avatar hjk Committed by hjk

debugger: better guess at childnumchild value for compact transmission

Change-Id: I85626b75f49cdcb8f026ca0389e796fdca4d1f65
Reviewed-on: http://codereview.qt.nokia.com/3331Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 53453a23
......@@ -340,17 +340,21 @@ class Children:
self.addrBase = addrBase
self.addrStep = addrStep
self.printsAddress = True
if not childType is None:
if childType is None:
self.childType = None
else:
self.childType = stripClassTag(str(childType))
self.d.put('childtype="%s",' % self.childType)
if isSimpleType(childType):
self.d.put('childnumchild="0",')
self.childNumChild = 0
elif childType.code == PointerCode:
self.d.put('childnumchild="1",')
self.childNumChild = 1
else:
self.childType = None
if childNumChild is None:
if isSimpleType(childType):
self.d.put('childnumchild="0",')
self.childNumChild = 0
elif childType.code == PointerCode:
self.d.put('childnumchild="1",')
self.childNumChild = 1
else:
self.d.put('childnumchild="%s",' % childNumChild)
self.childNumChild = childNumChild
try:
if not addrBase is None and not addrStep is None:
self.d.put('addrbase="0x%x",' % long(addrBase))
......
......@@ -2671,12 +2671,27 @@ namespace basic {
dummyStatement(&a, &b, &c, &d);
}
void testLongEvaluation()
void testLongEvaluation1()
{
QDateTime time = QDateTime::currentDateTime();
QVector<QDateTime> bigv;
for (int i = 0; i < 10000; ++i)
bigv.append(time);
const int N = 10000;
QDateTime bigv[N];
for (int i = 0; i < N; ++i) {
bigv[i] = time;
time.addDays(1);
}
// <== Break here.
// Expand bigv.
// This is expected to take up to a minute.
dummyStatement(&bigv);
}
void testLongEvaluation2()
{
const int N = 10000;
int bigv[N];
for (int i = 0; i < N; ++i)
bigv[i] = i;
// <== Break here.
// Expand bigv.
// This is expected to take up to a minute.
......@@ -2725,7 +2740,8 @@ namespace basic {
testStringWithNewline();
testMemoryView();
testColoredMemoryView();
testLongEvaluation();
testLongEvaluation1();
testLongEvaluation2();
testFork();
testFunctionPointer();
}
......
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