Changeset 6d89e3c in rtems-tools


Ignore:
Timestamp:
Aug 1, 2013, 6:50:23 AM (6 years ago)
Author:
Dhananjay Balan <mb.dhananjay@…>
Branches:
4.10, 4.11, master
Children:
66d0779
Parents:
e60a5ee
git-author:
Dhananjay Balan <mb.dhananjay@…> (08/01/13 06:50:23)
git-committer:
Chris Johns <chrisj@…> (08/24/14 23:52:40)
Message:

Refactor

  • The objects are intialized using the objects rather than the ID.
Location:
tools/gdb/python
Files:
2 edited

Legend:

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

    re60a5ee r6d89e3c  
    109109    "Print a classic semaphore."
    110110
    111     def __init__(self, id):
    112         self.id = id;
    113         self.object = objects.information.object(self.id).dereference()
     111    def __init__(self, obj):
     112        self.object = obj
    114113        self.object_control = objects.control(self.object['Object'])
    115114        self.attr = attribute(self.object['attribute_set'], 'semaphore')
     
    150149    "Print a classic task"
    151150
    152     def __init__(self, id):
    153         self.id = id;
     151    def __init__(self, obj):
     152        self.object = obj
    154153        self.task = \
    155             threads.control(objects.information.object(self.id).dereference())
     154            threads.control(self.object)
    156155        self.wait_info = self.task.wait_info()
    157156
     
    168167    "Print classic messege queue"
    169168
    170     def __init__(self,id):
    171         self.id = id
    172         self.object = objects.information.object(self.id).dereference()
     169    def __init__(self,obj):
     170        self.object = obj
    173171        self.object_control = objects.control(self.object['Object'])
    174172        self.attr = attribute(self.object['attribute_set'], \
     
    188186    '''Print a classic timer'''
    189187
    190     def __init__(self, id):
    191         self.id = id
    192         self.object = objects.information.object(self.id).dereference()
     188    def __init__(self, obj):
     189        self.object = obj
    193190        self.object_control = objects.control(self.object['Object'])
    194191        self.watchdog = watchdog.control(self.object['Ticker'])
     
    201198    ''' Print a rtems partition '''
    202199
    203     def __init__(self, id):
    204         self.id = id
    205         self.object = objects.information.object(self.id).dereference()
     200    def __init__(self, obj):
     201        self.object = obj
    206202        self.object_control = objects.control(self.object['Object'])
    207203        self.attr = attribute(self.object['attribute_set'], 'partition')
     
    222218    "prints a classic region"
    223219
    224     def __init__(self,id):
    225         self.id = id
    226         self.object = objects.information.object(self.id).dereference()
     220    def __init__(self,obj):
     221        self.object = obj
    227222        self.object_control = objects.control(self.object['Object'])
    228223        self.attr = attribute(self.object['attribute_set'], 'region')
     
    240235    '''classic barrier abstraction'''
    241236
    242     def __init__(self,id):
    243         self.id = id
    244         self.object = objects.information.object(self.id).dereference()
     237    def __init__(self,obj):
     238        self.object = obj
    245239        self.object_control = objects.control(self.object['Object'])
    246240        self.attr = attribute(self.object['attribute_set'],'barrier')
  • tools/gdb/python/rtems.py

    re60a5ee r6d89e3c  
    7676
    7777    objects = {
    78         'classic/semaphores': lambda id: classic.semaphore(id),
    79         'classic/tasks': lambda id: classic.task(id),
    80         'classic/message_queues': lambda id: classic.message_queue(id),
    81         'classic/timers' : lambda id: classic.timer(id),
    82         'classic/partitions' : lambda id: classic.partition(id),
    83         'classic/regions' : lambda id: classic.region(id),
    84         'classic/barriers' : lambda id: classic.barrier(id)
     78        'classic/semaphores': lambda obj: classic.semaphore(obj),
     79        'classic/tasks': lambda obj: classic.task(obj),
     80        'classic/message_queues': lambda obj: classic.message_queue(obj),
     81        'classic/timers' : lambda obj: classic.timer(obj),
     82        'classic/partitions' : lambda obj: classic.partition(obj),
     83        'classic/regions' : lambda obj: classic.region(obj),
     84        'classic/barriers' : lambda obj: classic.barrier(obj)
    8585        }
    8686
     
    104104                (id.api(), id._class(), id.node(), id.index(), id.value())
    105105            objectname = id.api() + '/' + id._class()
     106
     107            obj = objects.information.object(id).dereference()
    106108            if objectname in self.objects:
    107                 object = self.objects[objectname](id)
     109                object = self.objects[objectname](obj)
    108110                object.show(from_tty)
    109111        objects.information.invalidate()
Note: See TracChangeset for help on using the changeset viewer.