Support to multi-threading and pthread interface (POSIX.1-2008) (#23)
[lunaix-os.git] / lunaix-os / scripts / gdb / lunadbg / structs / __init__.py
diff --git a/lunaix-os/scripts/gdb/lunadbg/structs/__init__.py b/lunaix-os/scripts/gdb/lunadbg/structs/__init__.py
new file mode 100644 (file)
index 0000000..8aa237d
--- /dev/null
@@ -0,0 +1,15 @@
+import gdb
+from ..pp import PrettyPrintable
+
+
+class KernelStruct(PrettyPrintable):
+    def __init__(self, gdb_inferior: gdb.Value, impl) -> None:
+        super().__init__()
+        self._kstruct = gdb_inferior.cast(impl.get_type())
+
+    def get_struct_instance(self):
+        return self._kstruct
+
+    @staticmethod
+    def get_type() -> gdb.Type :
+        return gdb.lookup_type("void").pointer()
\ No newline at end of file