Commit 3c3d4566 authored by hjk's avatar hjk

Debugger: Fix internal dumpers after modularisation

creatortypes.py wasn't included, and some d. qualification missing.

Change-Id: I1f444358cc1489f47083af39565147576f1885b7
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent a076dc6d
......@@ -31,8 +31,8 @@ from dumper import *
def qdump__Core__Id(d, value):
try:
name = parseAndEvaluate("Core::nameForId(%d)" % value["m_id"])
d.putValue(encodeCharArray(name), Hex2EncodedLatin1)
name = d.parseAndEvaluate("Core::nameForId(%d)" % value["m_id"])
d.putValue(d.encodeCharArray(name), Hex2EncodedLatin1)
d.putPlainChildren(value)
except:
d.putValue(value["m_id"])
......@@ -57,12 +57,12 @@ def qdump__Debugger__Internal__BreakpointModelId(d, value):
d.putPlainChildren(value)
def qdump__CPlusPlus__ByteArrayRef(d, value):
d.putValue(encodeCharArray(value["m_start"], 100, value["m_length"]),
d.putValue(d.encodeCharArray(value["m_start"], 100, value["m_length"]),
Hex2EncodedLatin1)
d.putPlainChildren(value)
def qdump__CPlusPlus__Identifier(d, value):
d.putValue(encodeCharArray(value["_chars"]), Hex2EncodedLatin1)
d.putValue(d.encodeCharArray(value["_chars"]), Hex2EncodedLatin1)
d.putPlainChildren(value)
def qdump__CPlusPlus__IntegerType(d, value):
......@@ -71,20 +71,20 @@ def qdump__CPlusPlus__IntegerType(d, value):
def qdump__CPlusPlus__NamedType(d, value):
literal = downcast(value["_name"])
d.putValue(encodeCharArray(literal["_chars"]), Hex2EncodedLatin1)
d.putValue(d.encodeCharArray(literal["_chars"]), Hex2EncodedLatin1)
d.putPlainChildren(value)
def qdump__CPlusPlus__TemplateNameId(d, value):
s = encodeCharArray(value["_identifier"]["_chars"])
s = d.encodeCharArray(value["_identifier"]["_chars"])
d.putValue(s + "3c2e2e2e3e", Hex2EncodedLatin1)
d.putPlainChildren(value)
def qdump__CPlusPlus__Literal(d, value):
d.putValue(encodeCharArray(value["_chars"]), Hex2EncodedLatin1)
d.putValue(d.encodeCharArray(value["_chars"]), Hex2EncodedLatin1)
d.putPlainChildren(value)
def qdump__CPlusPlus__StringLiteral(d, value):
d.putValue(encodeCharArray(value["_chars"]), Hex2EncodedLatin1)
d.putValue(d.encodeCharArray(value["_chars"]), Hex2EncodedLatin1)
d.putPlainChildren(value)
def qdump__CPlusPlus__Internal__Value(d, value):
......
......@@ -26,6 +26,7 @@ from qttypes import *
from stdtypes import *
from misctypes import *
from boosttypes import *
from creatortypes import *
#######################################################################
......@@ -939,7 +940,7 @@ class Dumper(DumperBase):
item = LocalItem()
item.name = resultVarName
item.iname = "return." + resultVarName
item.value = parseAndEvaluate(resultVarName)
item.value = self.parseAndEvaluate(resultVarName)
locals.append(item)
except:
# Don't bother. It's only supplementary information anyway.
......@@ -1058,6 +1059,9 @@ class Dumper(DumperBase):
self.currentAddress = item.savedCurrentAddress
return True
def parseAndEvaluate(self, exp):
return gdb.parse_and_eval(exp)
def call2(self, value, func, args):
# args is a tuple.
arg = ""
......@@ -1079,7 +1083,7 @@ class Dumper(DumperBase):
#warn("CALL: %s" % exp)
result = None
try:
result = parseAndEvaluate(exp)
result = self.parseAndEvaluate(exp)
except:
pass
#warn(" -> %s" % result)
......@@ -1174,7 +1178,7 @@ class Dumper(DumperBase):
self.putNumChild(0)
else:
try:
value = parseAndEvaluate(exp)
value = self.parseAndEvaluate(exp)
self.putItem(value)
except RuntimeError:
self.currentType = " "
......@@ -1681,7 +1685,7 @@ class Dumper(DumperBase):
#self.putAddress(value.address)
# Workaround for http://sourceware.org/bugzilla/show_bug.cgi?id=13380
if type.code == ArrayCode:
value = parseAndEvaluate("{%s}%s" % (type, value.address))
value = self.parseAndEvaluate("{%s}%s" % (type, value.address))
else:
try:
value = value.cast(type)
......
......@@ -1491,6 +1491,9 @@ class Dumper(DumperBase):
currentDir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
execfile(os.path.join(currentDir, "qttypes.py"))
execfile(os.path.join(currentDir, "stdtypes.py"))
execfile(os.path.join(currentDir, "misctypes.py"))
execfile(os.path.join(currentDir, "creatortypes.py"))
def doit():
......
......@@ -101,8 +101,8 @@ def qdump__QAbstractItemModel(d, value):
ri = makeValue(d.ns + "QModelIndex", "-1, -1, 0, 0")
this_ = makeExpression(value)
ri_ = makeExpression(ri)
rowCount = int(parseAndEvaluate("%s.rowCount(%s)" % (this_, ri_)))
columnCount = int(parseAndEvaluate("%s.columnCount(%s)" % (this_, ri_)))
rowCount = int(d.parseAndEvaluate("%s.rowCount(%s)" % (this_, ri_)))
columnCount = int(d.parseAndEvaluate("%s.columnCount(%s)" % (this_, ri_)))
except:
d.putPlainChildren(value)
return
......@@ -115,7 +115,7 @@ def qdump__QAbstractItemModel(d, value):
for column in xrange(columnCount):
with SubItem(d, i):
d.putName("[%s, %s]" % (row, column))
mi = parseAndEvaluate("%s.index(%d,%d,%s)"
mi = d.parseAndEvaluate("%s.index(%d,%d,%s)"
% (this_, row, column, ri_))
#warn("MI: %s " % mi)
#name = "[%d,%d]" % (row, column)
......@@ -155,8 +155,8 @@ def qdump__QModelIndex(d, value):
mi = makeValue(d.ns + "QModelIndex", "%s,%s,%s,%s" % (r, c, p, m))
mm_ = makeExpression(mm)
mi_ = makeExpression(mi)
rowCount = int(parseAndEvaluate("%s.rowCount(%s)" % (mm_, mi_)))
columnCount = int(parseAndEvaluate("%s.columnCount(%s)" % (mm_, mi_)))
rowCount = int(d.parseAndEvaluate("%s.rowCount(%s)" % (mm_, mi_)))
columnCount = int(d.parseAndEvaluate("%s.columnCount(%s)" % (mm_, mi_)))
except:
d.putEmptyValue()
d.putPlainChildren(value)
......@@ -164,7 +164,7 @@ def qdump__QModelIndex(d, value):
try:
# Access DisplayRole as value
val = parseAndEvaluate("%s.data(%s, 0)" % (mm_, mi_))
val = d.parseAndEvaluate("%s.data(%s, 0)" % (mm_, mi_))
v = val["d"]["data"]["ptr"]
d.putStringValue(makeValue(d.ns + 'QString', v))
except:
......@@ -178,7 +178,7 @@ def qdump__QModelIndex(d, value):
for column in xrange(columnCount):
with UnnamedSubItem(d, i):
d.putName("[%s, %s]" % (row, column))
mi2 = parseAndEvaluate("%s.index(%d,%d,%s)"
mi2 = d.parseAndEvaluate("%s.index(%d,%d,%s)"
% (mm_, row, column, mi_))
d.putItem(mi2)
i = i + 1
......@@ -1109,7 +1109,7 @@ def qdump__QObject(d, value):
% value1["type"])
gdb.execute("set $d.d.is_null = %s"
% value1["is_null"])
prop = parseAndEvaluate("$d").dereference()
prop = d.parseAndEvaluate("$d").dereference()
val, inner, innert, handled = \
qdumpHelper__QVariant(d, prop)
......
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