From 30cd73d2bbdd87b24640c8c0e8b8f3bdb13488b1 Mon Sep 17 00:00:00 2001 From: Patrick Mackinlay Date: Mon, 11 Mar 2024 13:02:41 +0700 Subject: ns32000: hook exceptions in debugger prior to entry * handle unexpected double memory abort --- src/devices/cpu/ns32000/ns32000.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/devices/cpu/ns32000') diff --git a/src/devices/cpu/ns32000/ns32000.cpp b/src/devices/cpu/ns32000/ns32000.cpp index 6fef593dfd8..123353299fb 100644 --- a/src/devices/cpu/ns32000/ns32000.cpp +++ b/src/devices/cpu/ns32000/ns32000.cpp @@ -812,6 +812,9 @@ template void ns32000_device::flags(u template void ns32000_device::interrupt(unsigned const trap) { + if (machine().debug_enabled() && (trap > ABT)) + debug()->exception_hook(trap); + unsigned offset = trap * 4; switch (trap) @@ -901,9 +904,6 @@ template void ns32000_device::interru m_sequential = false; m_icount -= top(SIZE_W, m_sp0) * 2 + top(SIZE_W, m_intbase + offset) + top(SIZE_D, m_sp0) + top(SIZE_D, m_mod); - - if (machine().debug_enabled() && (trap > ABT)) - debug()->exception_hook(trap); } template void ns32000_device::lpr(unsigned reg, addr_mode const mode, bool user, unsigned &tex) @@ -3615,7 +3615,18 @@ template void ns32000_device::execute } catch (ns32000_abort const &) { - interrupt(ABT); + try + { + interrupt(ABT); + } + catch (ns32000_abort const &) + { + // this shouldn't happen; probably indicates supervisor stack overflow (stuck interrupt?) + if (machine().debug_enabled()) + machine().debug_break(); + else + fatalerror("abort during abort entry 0x%08x\n", m_pc); + } } } } -- cgit v1.2.3-70-g09d2