summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDhananjay Balan <mb.dhananjay@gmail.com>2013-07-17 16:00:57 +0530
committerChris Johns <chrisj@rtems.org>2014-08-25 09:52:40 +1000
commit086e689955e3b0692d00bf2fc0ea1be7ed244e07 (patch)
treed476babc4119ae58d80c9dbc816c2df612b5bea7
parentFix typo: Global timer control object name. (diff)
downloadrtems-tools-086e689955e3b0692d00bf2fc0ea1be7ed244e07.tar.bz2
Added support for classic/timers.
-rw-r--r--tools/gdb/python/classic.py16
-rw-r--r--tools/gdb/python/rtems.py3
-rw-r--r--tools/gdb/python/watchdog.py19
3 files changed, 31 insertions, 7 deletions
diff --git a/tools/gdb/python/classic.py b/tools/gdb/python/classic.py
index 9af11df..1f5daf2 100644
--- a/tools/gdb/python/classic.py
+++ b/tools/gdb/python/classic.py
@@ -11,6 +11,7 @@ import re
import objects
import threads
+import watchdog
import supercore
class attribute:
@@ -179,4 +180,17 @@ class message_queue:
print ' Name:', self.object_control.name()
print ' Attr:', self.attr.to_string()
- self.core_control.show() \ No newline at end of file
+ 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() \ No newline at end of file
diff --git a/tools/gdb/python/rtems.py b/tools/gdb/python/rtems.py
index 4622ced..bd2d8e4 100644
--- a/tools/gdb/python/rtems.py
+++ b/tools/gdb/python/rtems.py
@@ -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):
diff --git a/tools/gdb/python/watchdog.py b/tools/gdb/python/watchdog.py
index 0766575..3678550 100644
--- a/tools/gdb/python/watchdog.py
+++ b/tools/gdb/python/watchdog.py
@@ -16,14 +16,14 @@ class state:
BEING_INSERTED = 1
ACTIVE = 2
REMOVE_IT = 3
-
+
states = {
0: 'inactive',
1: 'being-inserted',
2: 'active',
3: 'remove-it'
}
-
+
def __init__(self, s):
self.s = s
@@ -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() \ No newline at end of file