From 1fcff75505e4be2916bcd273a3670828363a0f67 Mon Sep 17 00:00:00 2001 From: Dhananjay Balan Date: Mon, 26 Aug 2013 20:35:57 +0530 Subject: Fix wdticks command - Type is Chain_Control - chain.node.next -> null --- tools/gdb/python/objects.py | 1 + tools/gdb/python/rtems.py | 9 +++++++-- tools/gdb/python/watchdog.py | 17 +++++++++++------ 3 files changed, 19 insertions(+), 8 deletions(-) (limited to 'tools/gdb') diff --git a/tools/gdb/python/objects.py b/tools/gdb/python/objects.py index f4ae5e1..ae2a4c7 100644 --- a/tools/gdb/python/objects.py +++ b/tools/gdb/python/objects.py @@ -14,6 +14,7 @@ class infotables: tables_types = { 'internal/time' : ('TOD_Control', '_TOD'), + 'internal/wdticks' : ('Chain_Control', '_Watchdog_Ticks_chain'), 'classic/tasks' : ('Thread_Control', '_RTEMS_tasks_Information'), 'classic/timers' : ('Timer_Control', '_Timer_Information'), diff --git a/tools/gdb/python/rtems.py b/tools/gdb/python/rtems.py index 64c7f1a..340c7ff 100644 --- a/tools/gdb/python/rtems.py +++ b/tools/gdb/python/rtems.py @@ -11,6 +11,7 @@ import re import objects import threads import chains +import watchdog import supercore import classic @@ -227,10 +228,14 @@ class rtems_watchdog_chain(gdb.Command): return nd = inst.first() + i = 0 + print ' Ticks Chain' while not nd.null(): wd = watchdog.control(nd.cast('Watchdog_Control')) - wd.show() - nd = nd.next() + print ' #'+str(i) + print wd.to_string() + nd.next() + i += 1 class rtems_wdt(rtems_watchdog_chain): diff --git a/tools/gdb/python/watchdog.py b/tools/gdb/python/watchdog.py index fef2f39..71a1816 100644 --- a/tools/gdb/python/watchdog.py +++ b/tools/gdb/python/watchdog.py @@ -52,10 +52,15 @@ class control: addr = self.ctrl['routine'] return str(addr) + def to_string(self): + val = "" + val += " State:" + str(self.state()) + val += "\n Intial Interval:" + str(self.initial()) + val += "\n Delta Interval:"+ str(self.delta_interval()) + val += "\n Start time:" + str(self.start_time()) + val += "\n Stop time:" + str(self.stop_time()) + val += "\n WD Routine:" + str(self.routine()) + return val + def show(self): - print " State:", self.state() - print " Intial Interval:", self.initial() - print " Delta Interval:", self.delta_interval() - print " Start time:", self.start_time() - print " Stop time:", self.stop_time() - print " WD Routine:", self.routine() \ No newline at end of file + print self.to_string() \ No newline at end of file -- cgit v1.2.3