diff options
author | Dhananjay Balan <mb.dhananjay@gmail.com> | 2013-07-12 19:04:37 +0530 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2014-08-25 09:52:40 +1000 |
commit | b061a67742d58bedaa161970c5cae028aa440e1f (patch) | |
tree | 0fa4782f602cc139b41ecb65386f15eb1ba15bed /tools/gdb/python/classic.py | |
parent | Update readme. (diff) | |
download | rtems-tools-b061a67742d58bedaa161970c5cae028aa440e1f.tar.bz2 |
Heavy refactoring + Improved mesege queu printing.
- pretty printers moved to the corresponding api_printer module
- object abstractions moved to
- their own name for core modules
- supercore for other supercore objects
- classic for classic api objects
Diffstat (limited to 'tools/gdb/python/classic.py')
-rw-r--r-- | tools/gdb/python/classic.py | 64 |
1 files changed, 6 insertions, 58 deletions
diff --git a/tools/gdb/python/classic.py b/tools/gdb/python/classic.py index d3f624d..e82078d 100644 --- a/tools/gdb/python/classic.py +++ b/tools/gdb/python/classic.py @@ -11,6 +11,7 @@ import re import objects import threads +import supercore class attribute: """The Classic API attribute.""" @@ -98,63 +99,6 @@ class attribute: return True return False -class attribute_printer: - - def __init__(self, attr): - self.attr = attribute(attr,'all') - - def to_string(self): - return gdb.Value(self.attr.to_string()) - -class semaphore_printer: - """Print a Semaphore_Control object. Print using the struct display hint - and an iterator.""" - - class iterator: - """Use an iterator for each field expanded from the id so GDB output - is formatted correctly.""" - - def __init__(self, semaphore): - self.semaphore = semaphore - self.count = 0 - - def __iter__(self): - return self - - def next(self): - self.count += 1 - if self.count == 1: - return self.semaphore['Object'] - elif self.count == 2: - attr = attribute(self.semaphore['attribute_set'], - 'semaphore') - return attr.to_string() - elif self.count == 3: - return self.semaphore['Core_control'] - raise StopIteration - - def __init__(self, semaphore): - self.semaphore = semaphore - - def to_string(self): - return '' - - @staticmethod - def key(i): - if i == 0: - return 'Object' - elif i == 1: - return 'attribute_set' - elif i == 2: - return 'Core_control' - return 'bad' - - def children(self): - counter = itertools.imap (self.key, itertools.count()) - return itertools.izip (counter, self.iterator(self.semaphore)) - - def display_hint (self): - return 'struct' class semaphore: "Print a classic semaphore." @@ -225,9 +169,13 @@ class message_queue: self.object_control = objects.control(self.object['Object']) self.attr = attribute(self.object['attribute_set'], \ 'message_queue') + self.wait_queue = threads.queue( \ + self.object['message_queue']['Wait_queue']) + + self.core_control = supercore.CORE_message_queue(self.object['message_queue']) def show(self, from_tty): print ' Name:', self.object_control.name() print ' Attr:', self.attr.to_string() - + self.core_control.show()
\ No newline at end of file |