- Documented and Debugged containers
- Attempted to setup gdb prettywriters
This commit is contained in:
26
gdb/list.py
Normal file
26
gdb/list.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import sys
|
||||
class ListPrinter:
|
||||
"""Print a fennec::list"""
|
||||
|
||||
class Iterator:
|
||||
def __init__(self, head):
|
||||
self.node = head
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def __next__(self):
|
||||
if self.node == sys.maxsize:
|
||||
raise StopIteration
|
||||
value = self.node['*data']
|
||||
self.node = self.node['_data[next]']
|
||||
return value
|
||||
|
||||
def __init__(self, val):
|
||||
self.val = val
|
||||
|
||||
def to_string(self):
|
||||
return "fennec::list"
|
||||
|
||||
def children(self):
|
||||
return enumerate(self.Iterator(self.val['_data[_root]']))
|
||||
Reference in New Issue
Block a user