Changeset 086e689 in rtems-tools for tools/gdb


Ignore:
Timestamp:
Jul 17, 2013, 10:30:57 AM (6 years ago)
Author:
Dhananjay Balan <mb.dhananjay@…>
Branches:
4.10, 4.11, e9f48e9face6c4dea62712d73b35412c0fe10332
Children:
09086b4
Parents:
591fbf6
git-author:
Dhananjay Balan <mb.dhananjay@…> (07/17/13 10:30:57)
git-committer:
Chris Johns <chrisj@…> (08/24/14 23:52:40)
Message:

Added support for classic/timers.

Location:
tools/gdb/python
Files:
3 edited

Legend:

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

    r591fbf6 r086e689  
    1212import objects
    1313import threads
     14import watchdog
    1415import supercore
    1516
     
    181182
    182183        self.core_control.show()
     184
     185class timer:
     186    '''Print a classic timer'''
     187
     188    def __init__(self, id):
     189        self.id = id
     190        self.object = objects.information.object(self.id).dereference()
     191        self.object_control = objects.control(self.object['Object'])
     192        self.watchdog = watchdog.control(self.object['Ticker'])
     193
     194    def show(self, from_tty):
     195        print '     Name:', self.object_control.name()
     196        self.watchdog.show()
  • tools/gdb/python/rtems.py

    r591fbf6 r086e689  
    7878        'classic/semaphores': lambda id: classic.semaphore(id),
    7979        'classic/tasks': lambda id: classic.task(id),
    80         'classic/message_queues': lambda id: classic.message_queue(id)
     80        'classic/message_queues': lambda id: classic.message_queue(id),
     81        'classic/timers' : lambda id: classic.timer(id)
    8182        }
    8283
  • tools/gdb/python/watchdog.py

    r591fbf6 r086e689  
    1717    ACTIVE = 2
    1818    REMOVE_IT = 3
    19    
     19
    2020    states = {
    2121        0: 'inactive',
     
    2424        3: 'remove-it'
    2525        }
    26        
     26
    2727    def __init__(self, s):
    2828        self.s = s
     
    3636        self.ctrl = ctrl
    3737
     38    # Not sure if an extra class is needed.
    3839    def state(self):
    39         return state(self.ctrl['state']).to_string()
     40        return state(int(self.ctrl['state'])).to_string()
    4041
    4142    def initial(self):
     
    5152        return self.ctrl['stop_time']
    5253
     54    # ToDo: Better printing of watchdog.
    5355    def routine(self):
    5456        addr = self.ctrl['routine']
    55         sym = gdb.lookup_symbol(addr)
    56         print sym
     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 TracChangeset for help on using the changeset viewer.