diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2021-10-04 13:29:25 -0400 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2021-10-04 13:31:31 -0400 |
commit | 30d6d250531e14ce947c6911cb01606703c0783d (patch) | |
tree | 8deca2f8860fb1ac7a8f545d342611b2c9c797a3 /src/emu/debug | |
parent | aeb9eae87469e67bc6a91caf3840c34c11d959fc (diff) |
Fix multiple issues with debug memory tracking
- Track write accesses rather than read accesses
- Actually install the taps when the trackmem command is executed
- Correct cell addresses for address-shifted spaces in Qt and Windows memory viewers
Diffstat (limited to 'src/emu/debug')
-rw-r--r-- | src/emu/debug/debugcpu.cpp | 23 | ||||
-rw-r--r-- | src/emu/debug/debugcpu.h | 2 |
2 files changed, 20 insertions, 5 deletions
diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp index d28265d7b33..04cce887484 100644 --- a/src/emu/debug/debugcpu.cpp +++ b/src/emu/debug/debugcpu.cpp @@ -566,10 +566,10 @@ void device_debug::reinstall(address_space &space, read_or_write mode) if (m_track_mem) switch (space.data_width()) { - case 8: m_phw[id] = space.install_read_tap(0, space.addrmask(), "track_mem", [this, &space](offs_t address, u8 &data, u8 ) { write_tracking(space, address, data); }, m_phw[id]); break; - case 16: m_phw[id] = space.install_read_tap(0, space.addrmask(), "track_mem", [this, &space](offs_t address, u16 &data, u16) { write_tracking(space, address, data); }, m_phw[id]); break; - case 32: m_phw[id] = space.install_read_tap(0, space.addrmask(), "track_mem", [this, &space](offs_t address, u32 &data, u32) { write_tracking(space, address, data); }, m_phw[id]); break; - case 64: m_phw[id] = space.install_read_tap(0, space.addrmask(), "track_mem", [this, &space](offs_t address, u64 &data, u64) { write_tracking(space, address, data); }, m_phw[id]); break; + case 8: m_phw[id] = space.install_write_tap(0, space.addrmask(), "track_mem", [this, &space](offs_t address, u8 &data, u8 ) { write_tracking(space, address, data); }, m_phw[id]); break; + case 16: m_phw[id] = space.install_write_tap(0, space.addrmask(), "track_mem", [this, &space](offs_t address, u16 &data, u16) { write_tracking(space, address, data); }, m_phw[id]); break; + case 32: m_phw[id] = space.install_write_tap(0, space.addrmask(), "track_mem", [this, &space](offs_t address, u32 &data, u32) { write_tracking(space, address, data); }, m_phw[id]); break; + case 64: m_phw[id] = space.install_write_tap(0, space.addrmask(), "track_mem", [this, &space](offs_t address, u64 &data, u64) { write_tracking(space, address, data); }, m_phw[id]); break; } } } @@ -583,6 +583,21 @@ void device_debug::reinstall_all(read_or_write mode) } //------------------------------------------------- +// set_track_mem - start or stop tracking memory +// writes +//------------------------------------------------- + +void device_debug::set_track_mem(bool value) +{ + if (m_track_mem != value) + { + m_track_mem = value; + reinstall_all(read_or_write::WRITE); + } +} + + +//------------------------------------------------- // start_hook - the scheduler calls this hook // before beginning execution for the given device //------------------------------------------------- diff --git a/src/emu/debug/debugcpu.h b/src/emu/debug/debugcpu.h index 11a2f55843e..eba89367c2c 100644 --- a/src/emu/debug/debugcpu.h +++ b/src/emu/debug/debugcpu.h @@ -138,7 +138,7 @@ public: void track_pc_data_clear() { m_track_pc_set.clear(); } // memory tracking - void set_track_mem(bool value) { m_track_mem = value; } + void set_track_mem(bool value); offs_t track_mem_pc_from_space_address_data(const int& space, const offs_t& address, const u64& data) const; |