source: rtems-tools/tools/gdb/python/watchdog.py @ 09086b4

4.104.115
Last change on this file since 09086b4 was 086e689, checked in by Dhananjay Balan <mb.dhananjay@…>, on 07/17/13 at 10:30:57

Added support for classic/timers.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1#
2# RTEMS Watchdog Support
3# Copyright 2010 Chris Johns (chrisj@rtems.org)
4#
5# $Id$
6#
7
8import gdb
9
10import chains
11import objects
12
13class state:
14
15    INACTIVE = 0
16    BEING_INSERTED = 1
17    ACTIVE = 2
18    REMOVE_IT = 3
19
20    states = {
21        0: 'inactive',
22        1: 'being-inserted',
23        2: 'active',
24        3: 'remove-it'
25        }
26
27    def __init__(self, s):
28        self.s = s
29
30    def to_string(self):
31        return self.states[self.s]
32
33class control:
34
35    def __init__(self, ctrl):
36        self.ctrl = ctrl
37
38    # Not sure if an extra class is needed.
39    def state(self):
40        return state(int(self.ctrl['state'])).to_string()
41
42    def initial(self):
43        return self.ctrl['initial']
44
45    def delta_interval(self):
46        return self.ctrl['delta_interval']
47
48    def start_time(self):
49        return self.ctrl['start_time']
50
51    def stop_time(self):
52        return self.ctrl['stop_time']
53
54    # ToDo: Better printing of watchdog.
55    def routine(self):
56        addr = self.ctrl['routine']
57        return str(addr)
58
59    def show(self):
60        print "     State:", self.state()
61        print "     Intial Interval:", self.initial()
62        print "     Delta Interval:", self.delta_interval()
63        print "     Start time:", self.start_time()
64        print "     Stop time:", self.stop_time()
65        print "     WD Routine:", self.routine()
Note: See TracBrowser for help on using the repository browser.