From 6295ce0d67f305028c9523c711f5a27f97977879 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sat, 2 Sep 2023 21:33:02 +0300 Subject: [PATCH] insndb/core: walk over record opcodes --- src/openpower/insndb/core.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/openpower/insndb/core.py b/src/openpower/insndb/core.py index 403bacab..903f55bd 100644 --- a/src/openpower/insndb/core.py +++ b/src/openpower/insndb/core.py @@ -807,6 +807,9 @@ class Record(Dataclass): mdwn: MarkdownRecord svp64: SVP64Record = None + class Opcodes(tuple): + pass + @property def extras(self): if self.svp64 is not None: @@ -893,7 +896,7 @@ class Record(Dataclass): mask = Opcode.Mask(binary(mask)) result.append(Opcode(value=value, mask=mask)) - return tuple(result) + return self.__class__.Opcodes(result) @cached_property def PO(self): @@ -3740,6 +3743,8 @@ class Walker(mdis.walker.Walker): value = getattr(node, key) yield (value, node, key, mdis.walker.AttributePath) + yield (node.opcodes, node, "opcodes", mdis.walker.AttributePath) + @mdis.dispatcher.Hook(Operands) def dispatch_operands(self, node): def hook(cls_kwargs): -- 2.30.2