summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDhananjay Balan <mb.dhananjay@gmail.com>2013-08-15 20:26:30 +0530
committerChris Johns <chrisj@rtems.org>2014-08-25 09:52:41 +1000
commit2c25dc56edf95d1d60c48070431e68a31f9865f1 (patch)
tree12d38b223ed378f802a3c95559a663c4f3d61685
parentCatch nonvalid indexes. (diff)
downloadrtems-tools-2c25dc56edf95d1d60c48070431e68a31f9865f1.tar.bz2
Add message_queue subcommand.
-rw-r--r--tools/gdb/python/rtems.py35
1 files changed, 34 insertions, 1 deletions
diff --git a/tools/gdb/python/rtems.py b/tools/gdb/python/rtems.py
index dbfd7c7..9ae2105 100644
--- a/tools/gdb/python/rtems.py
+++ b/tools/gdb/python/rtems.py
@@ -172,6 +172,38 @@ class rtems_task(gdb.Command):
instance.show(from_tty)
objects.information.invalidate()
+class rtems_message_queue(gdb.Command):
+ '''Message Queue subcommand'''
+
+ api = 'classic'
+ _class = 'message_queues'
+
+ def __init__(self):
+ self.__doc__ = 'Display the RTEMS message_queue by index(s)'
+ super(rtems_message_queue,self).__init__('rtems mqueue', gdb.COMMAND_STATUS)
+
+ def invoke(self, arg, from_tty):
+ for val in arg.split():
+ try:
+ index = int(val)
+ except ValueError:
+ print "error: %s is not an index" % (val)
+ return
+
+ try:
+ obj = objects.information.object_return(self.api,
+ self._class,
+ index).dereference()
+ except IndexError:
+ print "error: index %s is invalid" % (index)
+ return
+
+ print "Ahi"
+ instance = classic.message_queue(obj)
+ instance.show(from_tty)
+ objects.information.invalidate()
+
+
#
# Main
#
@@ -182,4 +214,5 @@ gdb.pretty_printers.append (lookup_function)
rtems()
rtems_object()
rtems_semaphore()
-rtems_task() \ No newline at end of file
+rtems_task()
+rtems_message_queue() \ No newline at end of file