Commit 759fcca0 authored by hjk's avatar hjk

debugger: various small fixes for Qt 5 dumpers

Change-Id: I28d483fb3b3957aa1a1772d7f4c497192d730418
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 272de98a
......@@ -498,14 +498,21 @@ def check(exp):
if not exp:
raise RuntimeError("Check failed")
def checkSimpleRef(ref):
count = ref["_q_value"]
check(count > 0)
check(count < 1000000)
def checkRef(ref):
count = 0
# assume there aren't a million references to any object
if qtMajorVersion() >= 5:
count = ref["atomic"]["_q_value"]
check(count >= -1)
check(count < 1000000)
else:
count = ref["_q_value"]
check(count > 0)
check(count < 1000000) # assume there aren't a million references to any object
check(count > 0)
check(count < 1000000)
#def couldBePointer(p, align):
# type = lookupType("unsigned int")
......
......@@ -511,7 +511,7 @@ def qdump__QImage(d, value):
if isNull(d_ptr):
d.putValue("(null)")
else:
checkRef(d_ptr["ref"])
checkSimpleRef(d_ptr["ref"])
d.putValue("(%dx%d)" % (d_ptr["width"], d_ptr["height"]))
bits = d_ptr["data"]
nbytes = d_ptr["nbytes"]
......@@ -1116,7 +1116,7 @@ def qdump__QPixmap(d, value):
if isNull(d_ptr):
d.putValue("(null)")
else:
checkRef(d_ptr["ref"])
checkSimpleRef(d_ptr["ref"])
d.putValue("(%dx%d)" % (d_ptr["w"], d_ptr["h"]))
d.putNumChild(0)
......
......@@ -63,7 +63,7 @@
// a test after a BREAK_HERE failed
// Default: 0
#ifndef USE_AUTORUN
#define USE_AUTORUN 0
#define USE_AUTORUN 2
#endif
// With USE_AUTOBREAK, the debugger will stop automatically on all
......@@ -2278,8 +2278,7 @@ namespace stdarray {
std::array<int, 4> a = { { 1, 2, 3, 4} };
BREAK_HERE;
// Expand a.
// Check a <4 items> std::array<int>.
// Check [0] 1 int.
// Check a <4 items> std::array<int, 4u>.
// Continue.
dummyStatement(&a);
#endif
......@@ -2701,7 +2700,7 @@ namespace stdptr {
#ifdef USE_CXX11
std::unique_ptr<int> p(new int(32));
BREAK_HERE;
// Check p 32 std::unique_ptr<int>.
// Check p 32 std::unique_ptr<int, std::default_delete<int> >.
// Continue.
dummyStatement(&p);
#endif
......@@ -5039,7 +5038,7 @@ namespace qscript {
s.setProperty("a", QScriptValue());
QScriptValue d = s.data();
BREAK_HERE;
// Check s <not accessible> QScriptValue (JSCoreValue).
// Check s <native> QScriptValue (JSCoreValue).
// Check d (invalid) QScriptValue.
// Check v 43 QVariant (int).
// Check x 33 int.
......
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