- Documented and Debugged containers

- Attempted to setup gdb prettywriters
This commit is contained in:
2025-08-07 19:03:34 -04:00
parent 0f721f57ea
commit 2cb41e1437
19 changed files with 1047 additions and 403 deletions

26
gdb/list.py Normal file
View 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]']))

10
gdb/printers.py Normal file
View File

@@ -0,0 +1,10 @@
from list import ListPrinter
def lookup_function(val):
if str(val.type) == "fennec::list":
return ListPrinter(val)
return None
gdb.pretty_printers.append(lookup_function)