Changeset 2c25dc5 in rtems-tools for tools/gdb


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

Add message_queue subcommand.

File:
1 edited

Legend:

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

    rb743d63 r2c25dc5  
    173173        objects.information.invalidate()
    174174
     175class rtems_message_queue(gdb.Command):
     176    '''Message Queue subcommand'''
     177
     178    api = 'classic'
     179    _class = 'message_queues'
     180
     181    def __init__(self):
     182        self.__doc__ = 'Display the RTEMS message_queue by index(s)'
     183        super(rtems_message_queue,self).__init__('rtems mqueue', gdb.COMMAND_STATUS)
     184
     185    def invoke(self, arg, from_tty):
     186        for val in arg.split():
     187            try:
     188                index = int(val)
     189            except ValueError:
     190                print "error: %s is not an index" % (val)
     191                return
     192
     193            try:
     194                obj = objects.information.object_return(self.api,
     195                                                        self._class,
     196                                                        index).dereference()
     197            except IndexError:
     198                print "error: index %s is invalid" % (index)
     199                return
     200
     201            print "Ahi"
     202            instance = classic.message_queue(obj)
     203            instance.show(from_tty)
     204        objects.information.invalidate()
     205
     206
    175207#
    176208# Main
     
    184216rtems_semaphore()
    185217rtems_task()
     218rtems_message_queue()
Note: See TracChangeset for help on using the changeset viewer.