From a1005c1bec6a329af7cb7240a52f8f4a9cc05efe Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 1 Apr 2024 14:37:37 +0100 Subject: [PATCH] Add convenience 'Square' constructor in GDB utils --- utils/gdb/seer_pretty_printers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/gdb/seer_pretty_printers.py b/utils/gdb/seer_pretty_printers.py index 8d983c6..c80f6a7 100644 --- a/utils/gdb/seer_pretty_printers.py +++ b/utils/gdb/seer_pretty_printers.py @@ -14,6 +14,10 @@ class Square(object): def __init__(self, val): self._val = val + @classmethod + def from_file_rank(cls, file, rank): + return cls(file * 8 + rank) + def __str__(self): return self.FILES[self.file] + self.RANKS[self.rank]