From 7fae8c129f5f9e810d6165736d65047c015512a6 Mon Sep 17 00:00:00 2001 From: Toby Jaffey Date: Thu, 11 Dec 2025 17:48:00 +0000 Subject: [PATCH] Zero extram on startup. On crash, dump extram to file --- hosts/host/host.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hosts/host/host.c b/hosts/host/host.c index 31663b4..b086c79 100644 --- a/hosts/host/host.c +++ b/hosts/host/host.c @@ -203,6 +203,7 @@ int main(int argc, char *argv[]) { printf("Failed to allocate extram!\n"); return 1; } + memset(extram_buf, 0x00, extram_len); uvm32_extram(&vmst, extram_buf, extram_len); } @@ -227,6 +228,10 @@ int main(int argc, char *argv[]) { isrunning = false; memdump("host-ram.dump", vmst.memory, UVM32_MEMORY_SIZE); printf("memory dumped to host-ram.dump, pc=0x%08x\n", vmst.core.pc); + if (extram_buf != NULL) { + memdump("host-extram.dump", (uint8_t *)extram_buf, extram_len); + printf("extram dumped to host-extram.dump\n"); + } } break; case UVM32_EVT_SYSCALL: