better formatting in memory dump

float_support
Anton Lydike 4 years ago
parent f43c33b0d7
commit c3faaaed02

@ -192,8 +192,8 @@ class LoadedMemorySection:
# this section holds instructions! # this section holds instructions!
start = max(self.base - at_addr - (max_rows // 2), 0) start = max(self.base - at_addr - (max_rows // 2), 0)
end = min(self.size, start + max_rows) end = min(self.size, start + max_rows)
print(FMT_BOLD + FMT_MAGENTA + "MemorySection {} at base 0x{:08X}, viewing {} instructions:".format( print(FMT_BOLD + FMT_MAGENTA + "{}, viewing {} instructions:".format(
self.name, self.base, end - start self, end - start
) + FMT_NONE) ) + FMT_NONE)
for i in range(start, end): for i in range(start, end):
if i == highlight: if i == highlight:
@ -202,8 +202,8 @@ class LoadedMemorySection:
ins = repr(self.content[i]) ins = repr(self.content[i])
print(fmt_str.format(self.base + i, ins)) print(fmt_str.format(self.base + i, ins))
else: else:
print(FMT_BOLD + FMT_MAGENTA + "MemorySection {} at base 0x{:08X}, viewing {} bytes:".format( print(FMT_BOLD + FMT_MAGENTA + "{}, viewing {} bytes:".format(
self.name, self.base, end - start self, end - start
) + FMT_NONE) ) + FMT_NONE)
for i in range(start, end, bytes_per_row): for i in range(start, end, bytes_per_row):
data = self.content[start + i: min(start + i + bytes_per_row, end)] data = self.content[start + i: min(start + i + bytes_per_row, end)]

Loading…
Cancel
Save