diff options
author | Dhananjay Balan <mb.dhananjay@gmail.com> | 2013-08-24 15:08:16 +0530 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2014-08-25 09:52:41 +1000 |
commit | a245635a2e3c7b9ef5ebfc480b6115544c3d4340 (patch) | |
tree | e262d1ae675317e86f287bc80b2b9ac74d009a01 /tools/gdb/python/objects.py | |
parent | Update README.md (diff) | |
download | rtems-tools-a245635a2e3c7b9ef5ebfc480b6115544c3d4340.tar.bz2 |
Add subcommand
rtems tod - prints the time of day.
Diffstat (limited to 'tools/gdb/python/objects.py')
-rw-r--r-- | tools/gdb/python/objects.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/tools/gdb/python/objects.py b/tools/gdb/python/objects.py index 1a64a8d..58c2730 100644 --- a/tools/gdb/python/objects.py +++ b/tools/gdb/python/objects.py @@ -13,6 +13,8 @@ class infotables: """Manage the object information tables.""" tables_types = { + 'internal/time' : ('TOD_Control', '_TOD'), + 'classic/tasks' : ('Thread_Control', '_RTEMS_tasks_Information'), 'classic/timers' : ('Timer_Control', '_Timer_Information'), 'classic/semaphores' : ('Semaphore_Control', '_Semaphore_Information'), @@ -64,15 +66,21 @@ class infotables: index = id.index() return self.object_return(api, _class, index) - def object_return(self, api, _class, index): + def object_return(self, api, _class, index=-1): n = self.name(api, _class) self.load(n) - max = self.maximum(api, _class) - if index > max: - raise IndexError('object index out of range (%d)' % (max)) + table_type = self.tables_types[n] - expr = '(' + table_type[0] + '*)' + \ - table_type[1] + '.local_table[' + str(index) + ']' + + if api == 'internal': + expr = '(' + table_type[0] + ')' + table_type[1] + + else: + max = self.maximum(api, _class) + if index > max: + raise IndexError('object index out of range (%d)' % (max)) + expr = '(' + table_type[0] + '*)' + \ + table_type[1] + '.local_table[' + str(index) + ']' return gdb.parse_and_eval(expr) def is_string(self, api, _class): |