summaryrefslogtreecommitdiff
path: root/tools/gdb/python/classic.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gdb/python/classic.py')
-rw-r--r--tools/gdb/python/classic.py64
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