diff --git a/share/qtcreator/debugger/creatortypes.py b/share/qtcreator/debugger/creatortypes.py index 2b25e2240ffb0723a6a58c63af734dac9de23002..6bc28168ed3052a75d3587394924cd52ee52a299 100644 --- a/share/qtcreator/debugger/creatortypes.py +++ b/share/qtcreator/debugger/creatortypes.py @@ -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): diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index 837a276e9cd3a4453b75d1cf26b0ac2d6f8c84af..e111390f44a7149c74c0f1fec043dbc0421323dc 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -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) diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index fd424695d0b73c8de730a9eb290150a974fbde27..7c2d717ac453e8c20589f99a490b7340188cff4f 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -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(): diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index 11ec7104ae848fcb484e9fa424b2fb89a433ed7c..138b67cf1c6c65f1e13e26038438baa52d081eee 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -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)