summaryrefslogtreecommitdiff
path: root/python/basicblock.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2023-06-29 11:15:37 -0400
committerPeter LaFosse <peter@vector35.com>2023-06-29 11:54:03 -0400
commitd7ce6518974f5df461c5423c5cf89054e7bc2cea (patch)
tree41503af4c1b8a6e3f0903c6e34f49a39f77547ff /python/basicblock.py
parentcc1f563988449d813705c32124413904799ac532 (diff)
Implement __repr__ for all basic blocks in the base class
Diffstat (limited to 'python/basicblock.py')
-rw-r--r--python/basicblock.py6
1 files changed, 5 insertions, 1 deletions
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"<block: {self.arch.name}@{self.start:#x}-{self.end:#x}>"
+ 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))