From d7ce6518974f5df461c5423c5cf89054e7bc2cea Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Thu, 29 Jun 2023 11:15:37 -0400 Subject: Implement __repr__ for all basic blocks in the base class --- python/basicblock.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'python/basicblock.py') diff --git a/python/basicblock.py b/python/basicblock.py index 0195bbdc..98cc79fa 100644 --- a/python/basicblock.py +++ b/python/basicblock.py @@ -66,7 +66,11 @@ class BasicBlock: core.BNFreeBasicBlock(self.handle) def __repr__(self): - return f"" + arch = self.arch + if arch: + return f"<{self.__class__.__name__}: {arch.name}@{self.start}-{self.end}>" + else: + return f"<{self.__class__.__name__}: {self.start}-{self.end}>" def __len__(self): return int(core.BNGetBasicBlockLength(self.handle)) -- cgit v1.3.1