aboutsummaryrefslogtreecommitdiff
path: root/kapi/gdb/device.py
blob: 8e515ef88c7cf325c820749030f54308d321055d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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