summaryrefslogtreecommitdiff
path: root/Meta/serenity_gdb.py
diff options
context:
space:
mode:
Diffstat (limited to 'Meta/serenity_gdb.py')
-rw-r--r--Meta/serenity_gdb.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/Meta/serenity_gdb.py b/Meta/serenity_gdb.py
index ce4e6e6ac2..0aff2ad17b 100644
--- a/Meta/serenity_gdb.py
+++ b/Meta/serenity_gdb.py
@@ -159,6 +159,24 @@ class AKHashMapPrettyPrinter:
return elements
+class AKSinglyLinkedList:
+ def __init__(self, val):
+ self.val = val
+
+ def to_string(self):
+ return self.val.type.name
+
+ def children(self):
+ elements = []
+
+ node = self.val["m_head"]
+ while node != 0:
+ elements.append(node["value"])
+ node = node["next"]
+
+ return [(f"[{i}]", elements[i]) for i in range(len(elements))]
+
+
class AKInlineLinkedList:
def __init__(self, val):
self.val = val
@@ -218,6 +236,8 @@ class SerenityPrettyPrinterLocator(gdb.printing.PrettyPrinter):
return AKOwnPtr(val)
elif klass == 'AK::NonnullRefPtr':
return AKRefPtr(val)
+ elif klass == 'AK::SinglyLinkedList':
+ return AKSinglyLinkedList(val)
elif klass == 'AK::String':
return AKString(val)
elif klass == 'AK::StringView':