diff options
| author | Lukas Oesch <lukas.oesch@ost.ch> | 2026-06-10 10:40:46 +0200 |
|---|---|---|
| committer | Lukas Oesch <lukas.oesch@ost.ch> | 2026-06-10 10:40:46 +0200 |
| commit | 33abd5cf264cb9e34121082105b0bc17b3cf7a36 (patch) | |
| tree | 36b15d53fea04f4f9d9af817100f7ad013bd9b5c /kapi/gdb/devices | |
| parent | d01caf1c4aef3c89c68b9d1cc9fe56445f0860b5 (diff) | |
| parent | 7e27130c342b7299a1d2188a7192a7f17b5ac2ad (diff) | |
| download | kernel-develop.tar.xz kernel-develop.zip | |
Merge of BA-FS26 branch into develop
See merge request teachos/kernel!49
Diffstat (limited to 'kapi/gdb/devices')
| -rw-r--r-- | kapi/gdb/devices/__init__.py | 1 | ||||
| -rw-r--r-- | kapi/gdb/devices/device.py | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/kapi/gdb/devices/__init__.py b/kapi/gdb/devices/__init__.py new file mode 100644 index 0000000..3bab1ea --- /dev/null +++ b/kapi/gdb/devices/__init__.py @@ -0,0 +1 @@ +from .device import KapiDevicesDevicePrinter diff --git a/kapi/gdb/devices/device.py b/kapi/gdb/devices/device.py new file mode 100644 index 0000000..8e515ef --- /dev/null +++ b/kapi/gdb/devices/device.py @@ -0,0 +1,20 @@ +import gdb + + +class KapiDevicesDevicePrinter(gdb.ValuePrinter): + def __init__(self, val): + self.__val = val + + def to_string(self): + return ( + 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 |
