- The objects are intialized using the objects rather than the ID.
This commit is contained in:
Dhananjay Balan
2013-08-01 12:20:23 +05:30
committed by Chris Johns
parent e60a5eec0b
commit 6d89e3c34e
2 changed files with 25 additions and 29 deletions

View File

@@ -108,9 +108,8 @@ class attribute:
class semaphore:
"Print a classic semaphore."
def __init__(self, id):
self.id = id;
self.object = objects.information.object(self.id).dereference()
def __init__(self, obj):
self.object = obj
self.object_control = objects.control(self.object['Object'])
self.attr = attribute(self.object['attribute_set'], 'semaphore')
@@ -149,10 +148,10 @@ class semaphore:
class task:
"Print a classic task"
def __init__(self, id):
self.id = id;
def __init__(self, obj):
self.object = obj
self.task = \
threads.control(objects.information.object(self.id).dereference())
threads.control(self.object)
self.wait_info = self.task.wait_info()
def show(self, from_tty):
@@ -167,9 +166,8 @@ class task:
class message_queue:
"Print classic messege queue"
def __init__(self,id):
self.id = id
self.object = objects.information.object(self.id).dereference()
def __init__(self,obj):
self.object = obj
self.object_control = objects.control(self.object['Object'])
self.attr = attribute(self.object['attribute_set'], \
'message_queue')
@@ -187,9 +185,8 @@ class message_queue:
class timer:
'''Print a classic timer'''
def __init__(self, id):
self.id = id
self.object = objects.information.object(self.id).dereference()
def __init__(self, obj):
self.object = obj
self.object_control = objects.control(self.object['Object'])
self.watchdog = watchdog.control(self.object['Ticker'])
@@ -200,9 +197,8 @@ class timer:
class partition:
''' Print a rtems partition '''
def __init__(self, id):
self.id = id
self.object = objects.information.object(self.id).dereference()
def __init__(self, obj):
self.object = obj
self.object_control = objects.control(self.object['Object'])
self.attr = attribute(self.object['attribute_set'], 'partition')
self.starting_addr = self.object['starting_address']
@@ -221,9 +217,8 @@ class partition:
class region:
"prints a classic region"
def __init__(self,id):
self.id = id
self.object = objects.information.object(self.id).dereference()
def __init__(self,obj):
self.object = obj
self.object_control = objects.control(self.object['Object'])
self.attr = attribute(self.object['attribute_set'], 'region')
self.wait_queue = threads.queue(self.object['Wait_queue'])
@@ -239,9 +234,8 @@ class region:
class barrier:
'''classic barrier abstraction'''
def __init__(self,id):
self.id = id
self.object = objects.information.object(self.id).dereference()
def __init__(self,obj):
self.object = obj
self.object_control = objects.control(self.object['Object'])
self.attr = attribute(self.object['attribute_set'],'barrier')
self.core_b_control = supercore.barrier_control(self.object['Barrier'])

View File

@@ -75,13 +75,13 @@ class rtems_object(gdb.Command):
"""Object sub-command for RTEMS"""
objects = {
'classic/semaphores': lambda id: classic.semaphore(id),
'classic/tasks': lambda id: classic.task(id),
'classic/message_queues': lambda id: classic.message_queue(id),
'classic/timers' : lambda id: classic.timer(id),
'classic/partitions' : lambda id: classic.partition(id),
'classic/regions' : lambda id: classic.region(id),
'classic/barriers' : lambda id: classic.barrier(id)
'classic/semaphores': lambda obj: classic.semaphore(obj),
'classic/tasks': lambda obj: classic.task(obj),
'classic/message_queues': lambda obj: classic.message_queue(obj),
'classic/timers' : lambda obj: classic.timer(obj),
'classic/partitions' : lambda obj: classic.partition(obj),
'classic/regions' : lambda obj: classic.region(obj),
'classic/barriers' : lambda obj: classic.barrier(obj)
}
def __init__(self):
@@ -103,8 +103,10 @@ class rtems_object(gdb.Command):
print 'API:%s Class:%s Node:%d Index:%d Id:%08X' % \
(id.api(), id._class(), id.node(), id.index(), id.value())
objectname = id.api() + '/' + id._class()
obj = objects.information.object(id).dereference()
if objectname in self.objects:
object = self.objects[objectname](id)
object = self.objects[objectname](obj)
object.show(from_tty)
objects.information.invalidate()