summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDhananjay Balan <mb.dhananjay@gmail.com>2013-08-09 17:44:18 +0530
committerChris Johns <chrisj@rtems.org>2014-08-25 09:52:41 +1000
commita71368892a2010c9a2b8e9ae3ce1c23742b296c3 (patch)
tree1818290d1a8bc75b583548c0ee1a8ff261087144
parentAdd subcommand semaphore (diff)
downloadrtems-tools-a71368892a2010c9a2b8e9ae3ce1c23742b296c3.tar.bz2
Add task subcommand
rtems tasks <index(s)> - Prints tasks by index.
-rw-r--r--tools/gdb/python/rtems.py33
1 files changed, 32 insertions, 1 deletions
diff --git a/tools/gdb/python/rtems.py b/tools/gdb/python/rtems.py
index cf1ae07..8eb49c9 100644
--- a/tools/gdb/python/rtems.py
+++ b/tools/gdb/python/rtems.py
@@ -138,6 +138,36 @@ class rtems_semaphore(gdb.Command):
instance.show(from_tty)
objects.information.invalidate()
+class rtems_task(gdb.Command):
+ '''tasks subcommand for rtems'''
+
+ api = 'classic'
+ _class = 'tasks'
+
+ def __init__(self):
+ self.__doc__ = 'Display the RTEMS tasks by index(s)'
+ super(rtems_task,self).__init__('rtems task', gdb.COMMAND_STATUS)
+
+ def invoke(self, arg, from_tty):
+ for val in arg.split():
+ try:
+ index = int(val)
+ except ValueError:
+ print "error: %s is not an index" % (val)
+ return
+
+ try:
+ obj = objects.information.object_return(self.api,
+ self._class,
+ index).dereference()
+ except IndexError:
+ print "error: index %s is invalid" % (index)
+ return
+
+ instance = classic.task(obj)
+ instance.show(from_tty)
+ objects.information.invalidate()
+
#
# Main
#
@@ -147,4 +177,5 @@ gdb.pretty_printers = []
gdb.pretty_printers.append (lookup_function)
rtems()
rtems_object()
-rtems_semaphore() \ No newline at end of file
+rtems_semaphore()
+rtems_task() \ No newline at end of file