diff options
author | Dhananjay Balan <mb.dhananjay@gmail.com> | 2013-07-13 16:31:59 +0530 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2014-08-25 09:52:40 +1000 |
commit | 0967a1b679495f728781bd05318379024cadf5c5 (patch) | |
tree | 23e380a16be8f044df9d894855065d27664962f1 /tools/gdb/python/objects.py | |
parent | a785e254f2360e946baa14a11fbd3f403047b880 (diff) |
Refactoring
- drop _printer suffix from printer classes.
Diffstat (limited to '')
-rw-r--r-- | tools/gdb/python/objects.py | 51 |
1 files changed, 1 insertions, 50 deletions
diff --git a/tools/gdb/python/objects.py b/tools/gdb/python/objects.py index d2ba216..23ea7be 100644 --- a/tools/gdb/python/objects.py +++ b/tools/gdb/python/objects.py @@ -245,53 +245,4 @@ class control: def name(self): is_string = information.is_string(self._id.api(), self._id._class()) - return str(name(self.object['name'], is_string)) - - - - -class control_printer: - - class iterator: - """Use an iterator for each field expanded from the id so GDB output - is formatted correctly.""" - - def __init__(self, object): - self.object = object - self.count = 0 - - def __iter__(self): - return self - - def next(self): - self.count += 1 - if self.count == 1: - return self.object.node() - elif self.count == 2: - return self.object.id() - elif self.count == 3: - return self.object.name() - raise StopIteration - - def to_string(self): - return '' - - def __init__(self, object): - self.object = control(object) - - @staticmethod - def key(i): - if i == 0: - return 'Node' - elif i == 1: - return 'id' - elif i == 2: - return 'name' - return 'bad' - - def children(self): - counter = itertools.imap (self.key, itertools.count()) - return itertools.izip (counter, self.iterator(self.object)) - - def display_hint (self): - return 'struct' + return str(name(self.object['name'], is_string))
\ No newline at end of file |