Changeset b9ee5df in rtems-tools


Ignore:
Timestamp:
Jul 28, 2013, 9:15:58 AM (6 years ago)
Author:
Dhananjay Balan <mb.dhananjay@…>
Branches:
4.10, 4.11, e9f48e9face6c4dea62712d73b35412c0fe10332
Children:
c63080d
Parents:
c3d06d5
git-author:
Dhananjay Balan <mb.dhananjay@…> (07/28/13 09:15:58)
git-committer:
Chris Johns <chrisj@…> (08/24/14 23:52:40)
Message:

Add region support.

Abstractions for classic/region added.

Location:
tools/gdb/python
Files:
6 edited

Legend:

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

    rc3d06d5 rb9ee5df  
    99import itertools
    1010import re
     11#ToDo This shouldn't be here
     12import helper
    1113
    1214import objects
    1315import threads
    1416import watchdog
     17import heaps
    1518import supercore
    1619
     
    4245        'message_queue' : ['priority',
    4346                           'scope'],
    44         'partition' : ['scope']
     47        'partition' : ['scope'],
     48        'region' : ['priority']
    4549        }
    4650
     
    215219        print '     Attr:', self.attr.to_string()
    216220        print '   Length:', self.length
    217         print 'Buffer Size:', self.buffer_size
    218         print 'Used Blocks:', self.used_blocks
    219 
     221        print '   B Size:', self.buffer_size
     222        print ' U Blocks:', self.used_blocks
     223
     224class region:
     225    "prints a classic region"
     226
     227    def __init__(self,id):
     228        self.id = id
     229        self.object = objects.information.object(self.id).dereference()
     230        self.object_control = objects.control(self.object['Object'])
     231        self.attr = attribute(self.object['attribute_set'], 'region')
     232        self.wait_queue = threads.queue(self.object['Wait_queue'])
     233        self.heap = heaps.control(self.object['Memory'])
     234
     235    def show(self, from_tty):
     236        print '     Name:', self.object_control.name()
     237        print '     Attr:', self.attr.to_string()
     238        helper.tasks_printer_routine(self.wait_queue)
     239        print '   Memory:'
     240        self.heap.show()
  • tools/gdb/python/heaps.py

    rc3d06d5 rb9ee5df  
    1616        return True
    1717
     18    def val(self):
     19        return str(self.block)
    1820
    1921    def next(self):
     
    2628
    2729class stats:
    28     ''heap statistics''
     30    '''heap statistics'''
    2931
    3032    def __init__(self,stat):
    3133        self.stat = stat
     34
     35    def inst(self):
     36        i = self.stat['instance']
     37        return i
    3238
    3339    def avail(self):
     
    3844        return self.stat['free_size']
    3945
     46    def show(self):
     47        print '  Instance:',self.inst()
     48        print '     Avail:',self.avail()
     49        print '      Free:',self.free()
     50
    4051    # ToDo : incorporate others
    4152
    42 def control:
     53class control:
    4354    '''Abstract a heap control structure'''
    4455
     
    6172        st = stats(self.ctl['stats'])
    6273        return st
     74
     75    def show(self):
     76        fi = self.first()
     77        la = self.last()
     78
     79        print '     First:', fi.val()
     80        print '      Last:', la.val()
     81
     82        stats = self.stat()
     83        print '    stats:'
     84        stats.show()
  • tools/gdb/python/helper.py

    rc3d06d5 rb9ee5df  
    22# RTEMS GDB support helper routins.
    33
    4 def tasks_printer_rotuine(wait_queue):
     4def tasks_printer_routine(wait_queue):
    55    tasks = wait_queue.tasks()
    66    print '    Queue: len = %d, state = %s' % (len(tasks),wait_queue.state())
  • tools/gdb/python/objects.py

    rc3d06d5 rb9ee5df  
    1919        'classic/message_queues' : ('Message_queue_Control', '_Message_queue_Information'),
    2020        'classic/partitions'     : ('Partition_Control',     '_Partition_Information'),
    21         'classic/regions'        : ('Region_Control',        '_Regions_Information'),
     21        'classic/regions'        : ('Region_Control',        '_Region_Information'),
    2222        'classic/ports'          : ('Port_Control',          '_Port_Information'),
    2323        'classic/periods'        : ('Period_Control',        '_Period_Information'),
  • tools/gdb/python/rtems.py

    rc3d06d5 rb9ee5df  
    8080        'classic/message_queues': lambda id: classic.message_queue(id),
    8181        'classic/timers' : lambda id: classic.timer(id),
    82         'classic/partitions' : lambda id: classic.partition(id)
     82        'classic/partitions' : lambda id: classic.partition(id),
     83        'classic/regions' : lambda id: classic.region(id)
    8384        }
    8485
  • tools/gdb/python/supercore.py

    rc3d06d5 rb9ee5df  
    1616
    1717    def show(self):
    18         helper.tasks_printer_rotuine(self.wait_queue)
     18        helper.tasks_printer_routine(self.wait_queue)
Note: See TracChangeset for help on using the changeset viewer.