Also add _repr_ for UcReg

This commit is contained in:
mio 2024-03-08 17:07:08 +08:00
parent 13f17e5b3f
commit 4c4d582fcb
No known key found for this signature in database
GPG Key ID: DFF27E34A47CB873

View File

@ -15,6 +15,9 @@ uc_hook_h = ctypes.c_size_t
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.
@ -38,6 +41,7 @@ class UcReg(ctypes.Structure):
pass
_repr_ = _structure_repr
class UcTupledReg(UcReg, Generic[VT]):
"""A base class for registers whose values are represented as a set