summaryrefslogtreecommitdiff
path: root/chain/src/item/default/printer.py
blob: 5670545aec6e13a92b9e5c880861f719e8f1dd0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import lldb

class ForestPrinter:
    "Print a Forest"

    def __init__(self, val):
        self.forest = val
        self.root = val["root"]
        self.graph = val["graph"]

    def to_string(self):
        return "a forest with root {} and graph {}".format(self.root, self.graph)

def lookup(val):
    lookup_tag = val.type.tag
    if lookup_tag is None:
        return None
    if lookup_tag.startswith("chain::item::default::DefaultForest"):
        return ForestPrinter(val)

    return None


def ForestPrint(valobj, dict):
    objtype = valobj.type
    
    print(dir(valobj))
    print(valobj.GetValue())

    return "hihi"

# co sc i -r ../chain/src/item/default/printer.py
# type summary add -x "DefaultForest" -e -F printer.ForestPrint --category Rust