[rtems-tools commit] Support classic/partitions

Chris Johns chrisj at rtems.org
Sun Aug 24 23:45:33 UTC 2014


Module:    rtems-tools
Branch:    master
Commit:    09086b415db7bb08cca41fc3fff212bbaece327a
Changeset: http://git.rtems.org/rtems-tools/commit/?id=09086b415db7bb08cca41fc3fff212bbaece327a

Author:    Dhananjay Balan <mb.dhananjay at gmail.com>
Date:      Sat Jul 27 14:29:19 2013 +0530

Support classic/partitions
Added support for partition object.

---

 tools/gdb/python/classic.py         |   29 ++++++++++++++++++++++++++---
 tools/gdb/python/classic_printer.py |    4 +++-
 tools/gdb/python/rtems.py           |    3 ++-
 3 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/tools/gdb/python/classic.py b/tools/gdb/python/classic.py
index 1f5daf2..f7d4dfc 100644
--- a/tools/gdb/python/classic.py
+++ b/tools/gdb/python/classic.py
@@ -40,7 +40,8 @@ class attribute:
                      'priority',
                      'barrier'],
         'message_queue' : ['priority',
-                           'scope']
+                           'scope'],
+        'partition' : ['scope']
         }
 
     masks = {
@@ -163,7 +164,7 @@ class task:
         wait_info = self.task.wait_info()
 
 class message_queue:
-    "Print a classic messege queue"
+    "Print classic messege queue"
 
     def __init__(self,id):
         self.id = id
@@ -193,4 +194,26 @@ class timer:
 
     def show(self, from_tty):
         print '     Name:', self.object_control.name()
-        self.watchdog.show()
\ No newline at end of file
+        self.watchdog.show()
+
+class partition:
+    ''' Print a rtems partition '''
+
+    def __init__(self, id):
+        self.id = id
+        self.object = objects.information.object(self.id).dereference()
+        self.object_control = objects.control(self.object['Object'])
+        self.attr = attribute(self.object['attribute_set'], 'partition')
+        self.starting_addr = self.object['starting_address']
+        self.length = self.object['length']
+        self.buffer_size = self.object['buffer_size']
+        self.used_blocks = self.object['number_of_used_blocks']
+
+    def show(self, from_tty):
+        # ToDo: the printing still somewhat crude.
+        print '     Name:', self.object_control.name()
+        print '     Attr:', self.attr.to_string()
+        print '   Length:', self.length
+        print 'Buffer Size:', self.buffer_size
+        print 'Used Blocks:', self.used_blocks
+
diff --git a/tools/gdb/python/classic_printer.py b/tools/gdb/python/classic_printer.py
index a25d756..86e0eeb 100644
--- a/tools/gdb/python/classic_printer.py
+++ b/tools/gdb/python/classic_printer.py
@@ -1,6 +1,8 @@
 #
 # RTEMS Classic pretty printers for GDB
 #
+import classic
+import gdb
 
 class attribute:
 
@@ -12,7 +14,7 @@ class attribute:
         return gdb.Value(self.attr.to_string())
 
 class semaphore:
-    """ToDo: Print a Semaphore_Control object. Print using the struct display hint
+    """Print a Semaphore_Control object. Print using the struct display hint
     and an iterator. """
 
     class iterator:
diff --git a/tools/gdb/python/rtems.py b/tools/gdb/python/rtems.py
index bd2d8e4..eac5042 100644
--- a/tools/gdb/python/rtems.py
+++ b/tools/gdb/python/rtems.py
@@ -78,7 +78,8 @@ class rtems_object(gdb.Command):
         '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/timers' : lambda id: classic.timer(id),
+        'classic/partitions' : lambda id: classic.partition(id)
         }
 
     def __init__(self):



More information about the vc mailing list