aboutsummaryrefslogtreecommitdiff
path: root/kapi/gdb/device.py
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-05-07 12:09:27 +0200
committerFelix Morgner <felix.morgner@ost.ch>2026-05-07 12:09:27 +0200
commit6ac1537d07dffa3482bbccf710a77a7316191c2e (patch)
tree3f5d7158932344a29d790ae1705dc6b8607ce6b7 /kapi/gdb/device.py
parent35829497bdc0e00aa8f32b1855079fa5e2e0b084 (diff)
downloadkernel-6ac1537d07dffa3482bbccf710a77a7316191c2e.tar.xz
kernel-6ac1537d07dffa3482bbccf710a77a7316191c2e.zip
debug: use gdb.ValuePrinter base class
Diffstat (limited to 'kapi/gdb/device.py')
-rw-r--r--kapi/gdb/device.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/kapi/gdb/device.py b/kapi/gdb/device.py
index b655972..8e515ef 100644
--- a/kapi/gdb/device.py
+++ b/kapi/gdb/device.py
@@ -1,9 +1,20 @@
import gdb
-from teachos import TeachOSBasePrinter
-class KapiDevicesDevicePrinter(TeachOSBasePrinter):
+class KapiDevicesDevicePrinter(gdb.ValuePrinter):
+ def __init__(self, val):
+ self.__val = val
+
def to_string(self):
return (
- f"{self.value['m_name']} @ {self.value['m_major']}:{self.value['m_minor']}"
+ f"{self.__val['m_name']} @ {self.__val['m_major']}:{self.__val['m_minor']}"
)
+
+ def children(self):
+ yield ("major", self.__val["m_major"])
+ yield ("minor", self.__val["m_minor"])
+ yield ("name", self.__val["m_name"])
+ yield ("parent", self.__val["m_parent"])
+
+ def display_hint(self):
+ return None