forked from qt-creator/qt-creator
Debugger: Pass request to sort struct members to {gdb,lldb}bridge.py
The request will be honored when creating the values instead of re-sorting in the frontend. Change-Id: I0ea13bd9b0700a4d2ae4f0b355c56ddd37557398 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -262,6 +262,8 @@ class Dumper(DumperBase):
|
||||
self.autoDerefPointers = int(args.get("autoderef", "0"))
|
||||
self.partialUpdate = int(args.get("partial", "0"))
|
||||
self.fallbackQtVersion = 0x50200
|
||||
self.sortStructMembers = bool(args.get("sortStructMembers", True))
|
||||
|
||||
#warn("NAMESPACE: '%s'" % self.qtNamespace())
|
||||
#warn("EXPANDED INAMES: %s" % self.expandedINames)
|
||||
#warn("WATCHERS: %s" % self.watchers)
|
||||
@@ -399,6 +401,7 @@ class Dumper(DumperBase):
|
||||
# Don't bother. It's only supplementary information anyway.
|
||||
pass
|
||||
|
||||
locals.sort(key = lambda item: item.name)
|
||||
for item in locals:
|
||||
value = self.downcast(item.value) if self.useDynamicType else item.value
|
||||
with OutputSafer(self):
|
||||
@@ -1143,6 +1146,9 @@ class Dumper(DumperBase):
|
||||
|
||||
def putFields(self, value, dumpBase = True):
|
||||
fields = value.type.fields()
|
||||
if self.sortStructMembers:
|
||||
fields.sort(key = lambda field:
|
||||
'[' + field.name if field.is_base_class else field.name)
|
||||
|
||||
#warn("TYPE: %s" % value.type)
|
||||
#warn("FIELDS: %s" % fields)
|
||||
|
||||
Reference in New Issue
Block a user