Skip to content

Commit 4c4d582

Browse files
committed
Also add _repr_ for UcReg
1 parent 13f17e5 commit 4c4d582

File tree

1 file changed

+4
-0
lines changed
  • bindings/python/unicorn/unicorn_py3/arch

1 file changed

+4
-0
lines changed

bindings/python/unicorn/unicorn_py3/arch/types.py

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515

1616
VT = TypeVar('VT', bound=Tuple[int, ...])
1717

18+
def _structure_repr(self):
19+
return "%s(%s)" % (self.__class__.__name__, ", ".join("%s=%s" % (k, getattr(self, k)) for (k, _) in self._fields_))
20+
1821

1922
class UcReg(ctypes.Structure):
2023
"""A base class for composite registers.
@@ -38,6 +41,7 @@ def from_value(cls, value):
3841

3942
pass
4043

44+
_repr_ = _structure_repr
4145

4246
class UcTupledReg(UcReg, Generic[VT]):
4347
"""A base class for registers whose values are represented as a set

0 commit comments

Comments
 (0)