Added support for classic/timers.

This commit is contained in:
Dhananjay Balan
2013-07-17 16:00:57 +05:30
committed by Chris Johns
parent 591fbf65d3
commit 086e689955
3 changed files with 31 additions and 7 deletions

View File

@@ -11,6 +11,7 @@ import re
import objects
import threads
import watchdog
import supercore
class attribute:
@@ -180,3 +181,16 @@ class message_queue:
print ' Attr:', self.attr.to_string()
self.core_control.show()
class timer:
'''Print a classic timer'''
def __init__(self, id):
self.id = id
self.object = objects.information.object(self.id).dereference()
self.object_control = objects.control(self.object['Object'])
self.watchdog = watchdog.control(self.object['Ticker'])
def show(self, from_tty):
print ' Name:', self.object_control.name()
self.watchdog.show()

View File

@@ -77,7 +77,8 @@ class rtems_object(gdb.Command):
objects = {
'classic/semaphores': lambda id: classic.semaphore(id),
'classic/tasks': lambda id: classic.task(id),
'classic/message_queues': lambda id: classic.message_queue(id)
'classic/message_queues': lambda id: classic.message_queue(id),
'classic/timers' : lambda id: classic.timer(id)
}
def __init__(self):

View File

@@ -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()