Skip to content

Commit

Permalink
Also add _repr_ for UcReg
Browse files Browse the repository at this point in the history
  • Loading branch information
wtdcode committed Mar 8, 2024
1 parent 13f17e5 commit 4c4d582
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bindings/python/unicorn/unicorn_py3/arch/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

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

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


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

pass

_repr_ = _structure_repr

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

0 comments on commit 4c4d582

Please sign in to comment.