diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-10-17 16:05:14 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-10-19 11:17:36 +0000 |
commit | 89fe2681f7d9ccb293c6185bdbbc4095c5978f80 (patch) | |
tree | 68002f7f27f8f582bd8146e10b1c691f693d4fcf /share/qtcreator/debugger/dumper.py | |
parent | 99d65ffba5513f624334ec895d1a698feb0ef8e5 (diff) | |
download | qt-creator-89fe2681f7d9ccb293c6185bdbbc4095c5978f80.tar.gz |
[Debugger] Add dumpers for Python "PyObject"s
The dumper calls PyObject_Repr and shows the result of that as the
value of a PyObject.
It also adds three new sub fields to show the object class (type),
super class (base class), and the meta type (the type of the class
object).
Change-Id: I0612833321f6d2b50826588e775cfa12e1db28e4
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'share/qtcreator/debugger/dumper.py')
-rw-r--r-- | share/qtcreator/debugger/dumper.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 11c6b314f0..b48cf0b591 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -337,6 +337,10 @@ class DumperBase: #warn('EXPANDED INAMES: %s' % self.expandedINames) #warn('WATCHERS: %s' % self.watchers) + def resetPerStepCaches(self): + self.perStepCache = {} + pass + def resetCaches(self): # This is a cache mapping from 'type name' to 'display alternatives'. self.qqFormats = { 'QVariant (QVariantMap)' : mapForms() } @@ -355,6 +359,14 @@ class DumperBase: # to not be QObject derived, it contains a 0 value. self.knownStaticMetaObjects = {} + # A dictionary to serve as a per debugging step cache. + # Cleared on each step over / into / continue. + self.perStepCache = {} + + # A dictionary to serve as a general cache throughout the whole + # debug session. + self.generalCache = {} + self.counts = {} self.structPatternCache = {} self.pretimings = {} @@ -3670,6 +3682,9 @@ class DumperBase: error('wrong') return bytes(struct.pack(self.packCode + self.ptrCode(), address)) + def fromPointerData(self, bytes_value): + return struct.unpack(self.packCode + self.ptrCode(), bytes_value) + def createPointerValue(self, targetAddress, targetTypish): if not isinstance(targetTypish, self.Type) and not isinstance(targetTypish, str): error('Expected type in createPointerValue(), got %s' |