Changeset a7176a8 in rtems-tools for tools/gdb


Ignore:
Timestamp:
Aug 25, 2013, 5:33:44 PM (6 years ago)
Author:
Dhananjay Balan <mb.dhananjay@…>
Branches:
4.10, 4.11, master
Children:
a4d0739
Parents:
04d95ec
git-author:
Dhananjay Balan <mb.dhananjay@…> (08/25/13 17:33:44)
git-committer:
Chris Johns <chrisj@…> (08/24/14 23:52:41)
Message:

Add watchdog ticks command.

  • ToDo? : Fix watchdog states.
Location:
tools/gdb/python
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • tools/gdb/python/chains.py

    r04d95ec ra7176a8  
    4949        return node(self.ctrl['Tail']['Node'])
    5050
     51    def empty(self):
     52        if self.last() == self.first().next():
     53            return True
  • tools/gdb/python/main.py

    r04d95ec ra7176a8  
    1919rtems.rtems_message_queue()
    2020rtems.rtems_tod()
     21rtems.rtems_wdt()
  • tools/gdb/python/rtems.py

    r04d95ec ra7176a8  
    1111import objects
    1212import threads
     13import chains
    1314import supercore
    1415import classic
     
    206207        instance.show()
    207208        objects.information.invalidate()
     209
     210class rtems_watchdog_chain(gdb.Command):
     211    '''Print watchdog ticks chain'''
     212
     213    api = 'internal'
     214    _class = ''
     215
     216    def __init__(self,command):
     217        super(rtems_watchdog_chain, self).__init__ \
     218                                (command, gdb.COMMAND_DATA, gdb.COMPLETE_NONE)
     219
     220    def invoke(self, arg, from_tty):
     221        obj = objects.information.object_return(self.api, self._class)
     222
     223        inst = chains.control(obj)
     224
     225        if inst.empty():
     226            print '     error: empty chain'
     227            return
     228
     229        nd = inst.first()
     230        while not nd.null():
     231            wd = watchdog.control(nd.cast('Watchdog_Control'))
     232            wd.show()
     233            nd = nd.next()
     234
     235class rtems_wdt(rtems_watchdog_chain):
     236
     237    _class = 'wdticks'
     238
     239    def __init__(self):
     240        self.__doc__ = 'Display watchdog ticks chain'
     241        super(rtems_wdt, self).__init__('rtems wdticks')
     242
  • tools/gdb/python/watchdog.py

    r04d95ec ra7176a8  
    1212
    1313class state:
    14 
    15     INACTIVE = 0
    16     BEING_INSERTED = 1
    17     ACTIVE = 2
    18     REMOVE_IT = 3
    1914
    2015    states = {
     
    3631        self.ctrl = ctrl
    3732
    38     # Not sure if an extra class is needed.
     33    # ToDo: fix this.1
    3934    def state(self):
    40         return state(int(self.ctrl['state'])).to_string()
     35        return state(1).to_string()
     36        #return state(int(self.ctrl['state'])).to_string()
    4137
    4238    def initial(self):
Note: See TracChangeset for help on using the changeset viewer.