source: rtems-tools/tools/gdb/python/watchdog.py @ 10bcd5d

4.104.115
Last change on this file since 10bcd5d was 56a70ae, checked in by Dhananjay Balan <mb.dhananjay@…>, on 06/17/13 at 17:10:17

Intial commit.
Chris's intial work on the extenstions.

  • Property mode set to 100644
File size: 985 bytes
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    def state(self):
39        return state(self.ctrl['state']).to_string()
40
41    def initial(self):
42        return self.ctrl['initial']
43
44    def delta_interval(self):
45        return self.ctrl['delta_interval']
46
47    def start_time(self):
48        return self.ctrl['start_time']
49
50    def stop_time(self):
51        return self.ctrl['stop_time']
52
53    def routine(self):
54        addr = self.ctrl['routine']
55        sym = gdb.lookup_symbol(addr)
56        print sym
Note: See TracBrowser for help on using the repository browser.