From 1abdc79e5e4b94c8f66266bb66ea012f60ba8d3d Mon Sep 17 00:00:00 2001 From: Anton Lydike Date: Sat, 24 Apr 2021 21:48:45 +0200 Subject: [PATCH] added additional logging to invalid mmu data access, needs a better exception --- riscemu/MMU.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/riscemu/MMU.py b/riscemu/MMU.py index e4e4bfc..c54959e 100644 --- a/riscemu/MMU.py +++ b/riscemu/MMU.py @@ -167,6 +167,10 @@ class MMU: :param data: The bytearray to write (only first size bytes are written) """ sec = self.get_sec_containing(addr) + if sec is None: + print(FMT_MEM + '[MMU] Invalid write into non-initialized section at 0x{:08X}'.format(addr) + FMT_NONE) + raise RuntimeError("No write pls") + return sec.write(addr - sec.base, size, data) def dump(self, addr, *args, **kwargs):