Commit 759fcca0 authored by hjk's avatar hjk
Browse files

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