vm: stop earlier during page fault in debug builds
@@ -663,6 +663,11 @@ static void map_pageFault(unsigned int n, exc_context_t *ctx)
vaddr = hal_exceptionsFaultAddr(n, ctx);
paddr = (void *)((unsigned long)vaddr & ~(SIZE_PAGE - 1));
+#ifdef PAGEFAULTSTOP
+ process_dumpException(n, ctx);
+ __asm__ volatile ("1: b 1b");
+#endif
+
hal_cpuEnableInterrupts();
thread = proc_current();
@@ -675,10 +680,6 @@ static void map_pageFault(unsigned int n, exc_context_t *ctx)
if (vm_mapForce(map, paddr, prot)) {
process_dumpException(n, ctx);
-#ifdef PAGEFAULTSTOP
- __asm__ volatile ("1: b 1b");
-#endif
-
if (thread->process == NULL) {
hal_cpuDisableInterrupts();
hal_cpuHalt();
