added __repr__ to MMU and LoadedMemeorySection

float_support
Anton Lydike 4 years ago
parent 4b26ab6774
commit c4a28c9d1b

@ -211,6 +211,14 @@ class LoadedMemorySection:
else: else:
print(FMT_BOLD + FMT_MAGENTA + "..." + FMT_NONE) print(FMT_BOLD + FMT_MAGENTA + "..." + FMT_NONE)
def __repr__(self):
return "{} at 0x{:08X} (size={}bytes, flags={}, owner={})".format(
self.__class__.__name__,
self.base,
self.size,
self.flags,
self.owner
)
class LoadedExecutable: class LoadedExecutable:
""" """

@ -66,4 +66,9 @@ class MMU:
# debugging interactions: # debugging interactions:
def dump(self, addr, *args, **kwargs): def dump(self, addr, *args, **kwargs):
self.get_sec_containing(addr).dump(addr, *args, **kwargs) self.get_sec_containing(addr).dump(addr, *args, **kwargs)
def __repr__(self):
return "MMU(\n\t{}\n)".format(
"\n\t".join(repr(x) for x in self.sections)
)
Loading…
Cancel
Save