From d5d82fa30a13e6d6519a8d300ae7964a37215951 Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Mon, 9 Jul 2018 23:39:29 +0200 Subject: Watchpoint fixes (segfaults, wpclear not clearing) (nw) --- src/emu/debug/debugcpu.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/emu/debug/debugcpu.cpp') diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp index f0391249faa..36f23a52825 100644 --- a/src/emu/debug/debugcpu.cpp +++ b/src/emu/debug/debugcpu.cpp @@ -2885,9 +2885,9 @@ device_debug::watchpoint::watchpoint(device_debug* debugInterface, m_notifier = m_space.add_change_notifier([this](read_or_write mode) { if (m_enabled) { - if (u32(mode) & u32(read_or_write::READ)) + if (u32(mode) & u32(m_type) & u32(read_or_write::READ)) m_phr->remove(); - if (u32(mode) & u32(read_or_write::WRITE)) + if (u32(mode) & u32(m_type) & u32(read_or_write::WRITE)) m_phw->remove(); install(mode); } @@ -2896,6 +2896,10 @@ device_debug::watchpoint::watchpoint(device_debug* debugInterface, device_debug::watchpoint::~watchpoint() { + if (m_phr) + m_phr->remove(); + if (m_phw) + m_phw->remove(); m_space.remove_change_notifier(m_notifier); } -- cgit v1.2.3