summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2016-09-14 13:48:02 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2017-01-17 16:22:57 +0100
commit59b84bc78dff2adb265d9fa8edb4c42794cf9771 (patch)
tree929a0dd7e3d16dfc9d49dac3470fd11546819504 /solenv
parent1531152eff8061d63be5d98641fcafaa1da05167 (diff)
Change Idle to be a Timer subclass
Drops a lot of duplicated code, as Idle is just a convenience class for instant, mostly low priority timers. Change-Id: I847592e92e86d15ab1cab168bf0e667322e48048
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gdb/libreoffice/vcl.py26
1 files changed, 17 insertions, 9 deletions
diff --git a/solenv/gdb/libreoffice/vcl.py b/solenv/gdb/libreoffice/vcl.py
index 28ba3ebebc07..62dc3a06f09b 100644
--- a/solenv/gdb/libreoffice/vcl.py
+++ b/solenv/gdb/libreoffice/vcl.py
@@ -26,19 +26,27 @@ class ImplSchedulerDataPrinter(object):
def as_string(self, gdbobj):
if gdbobj['mpTask']:
- sched = gdbobj['mpTask'].dereference()
- if gdbobj['mpTask'].dynamic_cast( self.timer_type_ptr ):
- sched_type = "Timer"
- elif gdbobj['mpTask'].dynamic_cast( self.idle_type_ptr ):
- sched_type = "Idle"
+ task = gdbobj['mpTask'].dereference()
+ timer = gdbobj['mpTask'].dynamic_cast( self.timer_type_ptr )
+ idle = gdbobj['mpTask'].dynamic_cast( self.idle_type_ptr )
+ if idle:
+ task_type = "Idle"
+ elif timer:
+ task_type = "Timer"
else:
- assert sched_type, "Task object neither Timer nor Idle"
- res = "{:7s}{:10s} active: {:6s}".format( sched_type, str(sched['mePriority']), str(sched['mbActive']) )
- name = sched['mpDebugName']
+ task_type = "Task"
+ res = "{:7s}{:10s} active: {:6s}".format( task_type, str(task['mePriority']), str(task['mbActive']) )
+ name = task['mpDebugName']
if not name:
res = res + " (task debug name not set)"
else:
- res = "{} '{}' ({})".format(res, str(name.string()), str(sched.dynamic_type))
+ res = "{} '{}' ({})".format(res, str(name.string()), str(task.dynamic_type))
+ val_type = gdb.lookup_type(str( task.dynamic_type )).pointer()
+ timer = gdbobj['mpTask'].cast( val_type )
+ if (task_type == "Timer"):
+ res = "{}: {}ms".format(res, timer['mnTimeout'])
+ else:
+ assert 1 == timer['mnTimeout'], "Idle with timeout == {}".format( timer['mnTimeout'] )
return res
else:
assert gdbobj['mbDelete'], "No task set and not marked for deletion!"