debugger: better guess at childnumchild value for compact transmission

Change-Id: I85626b75f49cdcb8f026ca0389e796fdca4d1f65
Reviewed-on: http://codereview.qt.nokia.com/3331
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2011-08-22 11:17:50 +02:00
committed by hjk
parent 53453a2380
commit 7d219d788b
2 changed files with 34 additions and 14 deletions

View File

@@ -340,17 +340,21 @@ class Children:
self.addrBase = addrBase self.addrBase = addrBase
self.addrStep = addrStep self.addrStep = addrStep
self.printsAddress = True self.printsAddress = True
if not childType is None: if childType is None:
self.childType = None
else:
self.childType = stripClassTag(str(childType)) self.childType = stripClassTag(str(childType))
self.d.put('childtype="%s",' % self.childType) self.d.put('childtype="%s",' % self.childType)
if isSimpleType(childType): if childNumChild is None:
self.d.put('childnumchild="0",') if isSimpleType(childType):
self.childNumChild = 0 self.d.put('childnumchild="0",')
elif childType.code == PointerCode: self.childNumChild = 0
self.d.put('childnumchild="1",') elif childType.code == PointerCode:
self.childNumChild = 1 self.d.put('childnumchild="1",')
else: self.childNumChild = 1
self.childType = None else:
self.d.put('childnumchild="%s",' % childNumChild)
self.childNumChild = childNumChild
try: try:
if not addrBase is None and not addrStep is None: if not addrBase is None and not addrStep is None:
self.d.put('addrbase="0x%x",' % long(addrBase)) self.d.put('addrbase="0x%x",' % long(addrBase))

View File

@@ -2671,12 +2671,27 @@ namespace basic {
dummyStatement(&a, &b, &c, &d); dummyStatement(&a, &b, &c, &d);
} }
void testLongEvaluation() void testLongEvaluation1()
{ {
QDateTime time = QDateTime::currentDateTime(); QDateTime time = QDateTime::currentDateTime();
QVector<QDateTime> bigv; const int N = 10000;
for (int i = 0; i < 10000; ++i) QDateTime bigv[N];
bigv.append(time); 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. // <== Break here.
// Expand bigv. // Expand bigv.
// This is expected to take up to a minute. // This is expected to take up to a minute.
@@ -2725,7 +2740,8 @@ namespace basic {
testStringWithNewline(); testStringWithNewline();
testMemoryView(); testMemoryView();
testColoredMemoryView(); testColoredMemoryView();
testLongEvaluation(); testLongEvaluation1();
testLongEvaluation2();
testFork(); testFork();
testFunctionPointer(); testFunctionPointer();
} }