summaryrefslogtreecommitdiffstats
path: root/tools/gdb/python/watchdog.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gdb/python/watchdog.py')
-rw-r--r--tools/gdb/python/watchdog.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/tools/gdb/python/watchdog.py b/tools/gdb/python/watchdog.py
index 0766575..3678550 100644
--- a/tools/gdb/python/watchdog.py
+++ b/tools/gdb/python/watchdog.py
@@ -16,14 +16,14 @@ class state:
BEING_INSERTED = 1
ACTIVE = 2
REMOVE_IT = 3
-
+
states = {
0: 'inactive',
1: 'being-inserted',
2: 'active',
3: 'remove-it'
}
-
+
def __init__(self, s):
self.s = s
@@ -35,8 +35,9 @@ class control:
def __init__(self, ctrl):
self.ctrl = ctrl
+ # Not sure if an extra class is needed.
def state(self):
- return state(self.ctrl['state']).to_string()
+ return state(int(self.ctrl['state'])).to_string()
def initial(self):
return self.ctrl['initial']
@@ -50,7 +51,15 @@ class control:
def stop_time(self):
return self.ctrl['stop_time']
+ # ToDo: Better printing of watchdog.
def routine(self):
addr = self.ctrl['routine']
- sym = gdb.lookup_symbol(addr)
- print sym
+ return str(addr)
+
+ 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