Changeset a713688 in rtems-tools for tools/gdb


Ignore:
Timestamp:
Aug 9, 2013, 12:14:18 PM (6 years ago)
Author:
Dhananjay Balan <mb.dhananjay@…>
Branches:
4.10, 4.11, e9f48e9face6c4dea62712d73b35412c0fe10332
Children:
b743d63
Parents:
4797179
git-author:
Dhananjay Balan <mb.dhananjay@…> (08/09/13 12:14:18)
git-committer:
Chris Johns <chrisj@…> (08/24/14 23:52:41)
Message:

Add task subcommand
rtems tasks <index(s)> - Prints tasks by index.

File:
1 edited

Legend:

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

    r4797179 ra713688  
    139139        objects.information.invalidate()
    140140
     141class rtems_task(gdb.Command):
     142    '''tasks subcommand for rtems'''
     143
     144    api = 'classic'
     145    _class = 'tasks'
     146
     147    def __init__(self):
     148        self.__doc__ = 'Display the RTEMS tasks by index(s)'
     149        super(rtems_task,self).__init__('rtems task', gdb.COMMAND_STATUS)
     150
     151    def invoke(self, arg, from_tty):
     152        for val in arg.split():
     153            try:
     154                index = int(val)
     155            except ValueError:
     156                print "error: %s is not an index" % (val)
     157                return
     158
     159            try:
     160                obj = objects.information.object_return(self.api,
     161                                                        self._class,
     162                                                        index).dereference()
     163            except IndexError:
     164                print "error: index %s is invalid" % (index)
     165                return
     166
     167            instance = classic.task(obj)
     168            instance.show(from_tty)
     169        objects.information.invalidate()
     170
    141171#
    142172# Main
     
    149179rtems_object()
    150180rtems_semaphore()
     181rtems_task()
Note: See TracChangeset for help on using the changeset viewer.