summaryrefslogtreecommitdiff
path: root/tools/gdb/python/rtems.py
diff options
context:
space:
mode:
authorDhananjay Balan <mb.dhananjay@gmail.com>2013-08-01 12:20:23 +0530
committerChris Johns <chrisj@rtems.org>2014-08-25 09:52:40 +1000
commit6d89e3c34e68e61013abb39ff058bc5715eaa455 (patch)
tree66f72a1a1dbf8f8eebef9890e98836eed2eac773 /tools/gdb/python/rtems.py
parente60a5eec0b1e8b16d984e4baf7dccb3323b88928 (diff)
Refactor
- The objects are intialized using the objects rather than the ID.
Diffstat (limited to '')
-rw-r--r--tools/gdb/python/rtems.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/tools/gdb/python/rtems.py b/tools/gdb/python/rtems.py
index adab86d..b2dc776 100644
--- a/tools/gdb/python/rtems.py
+++ b/tools/gdb/python/rtems.py
@@ -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()