summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Scott Percival <code@moral.net.au>2021-03-03 10:01:17 +0000
committer GitHub <noreply@github.com>2021-03-03 11:01:17 +0100
commit5f4c4708ca67695468c114597e7e3408375dd098 (patch)
tree950486a9ff634a041cdbecb57e38d5b0a619feea /src
parent44cec5caaff1dbc24ee9f154c1745888b2319128 (diff)
Add 'wpsize' variable to access the data size from a watchpoint (#7837)
Diffstat (limited to 'src')
-rw-r--r--src/emu/debug/debugcpu.cpp4
-rw-r--r--src/emu/debug/debugcpu.h3
-rw-r--r--src/emu/debug/points.cpp2
3 files changed, 6 insertions, 3 deletions
diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp
index 422ff9fbca4..cf1d8eb5318 100644
--- a/src/emu/debug/debugcpu.cpp
+++ b/src/emu/debug/debugcpu.cpp
@@ -48,6 +48,7 @@ debugger_cpu::debugger_cpu(running_machine &machine)
, m_rpindex(1)
, m_wpdata(0)
, m_wpaddr(0)
+ , m_wpsize(0)
, m_last_periodic_update_time(0)
, m_comments_loaded(false)
{
@@ -57,9 +58,10 @@ debugger_cpu::debugger_cpu(running_machine &machine)
m_symtable = std::make_unique<symbol_table>(machine);
m_symtable->set_memory_modified_func([this]() { set_memory_modified(true); });
- /* add "wpaddr", "wpdata" to the global symbol table */
+ /* add "wpaddr", "wpdata", "wpsize" to the global symbol table */
m_symtable->add("wpaddr", symbol_table::READ_ONLY, &m_wpaddr);
m_symtable->add("wpdata", symbol_table::READ_ONLY, &m_wpdata);
+ m_symtable->add("wpsize", symbol_table::READ_ONLY, &m_wpsize);
screen_device_enumerator screen_enumerator = screen_device_enumerator(m_machine.root_device());
screen_device_enumerator::iterator iter = screen_enumerator.begin();
diff --git a/src/emu/debug/debugcpu.h b/src/emu/debug/debugcpu.h
index b21bd72b122..720c400b1ac 100644
--- a/src/emu/debug/debugcpu.h
+++ b/src/emu/debug/debugcpu.h
@@ -399,7 +399,7 @@ public:
void set_memory_modified(bool memory_modified) { m_memory_modified = memory_modified; }
void set_execution_stopped() { m_execution_state = exec_state::STOPPED; }
void set_execution_running() { m_execution_state = exec_state::RUNNING; }
- void set_wpinfo(offs_t address, u64 data) { m_wpaddr = address; m_wpdata = data; }
+ void set_wpinfo(offs_t address, u64 data, offs_t size) { m_wpaddr = address; m_wpdata = data; m_wpsize = size; }
// device_debug helpers
// [TODO] [RH]: Look into this more later, can possibly merge these two classes
@@ -437,6 +437,7 @@ private:
u64 m_wpdata;
u64 m_wpaddr;
+ u64 m_wpsize;
std::unique_ptr<u64[]> m_tempvar;
osd_ticks_t m_last_periodic_update_time;
diff --git a/src/emu/debug/points.cpp b/src/emu/debug/points.cpp
index 331b7449d1e..688881a40e6 100644
--- a/src/emu/debug/points.cpp
+++ b/src/emu/debug/points.cpp
@@ -335,7 +335,7 @@ void debug_watchpoint::triggered(read_or_write type, offs_t address, u64 data, u
address += m_space.alignment() - size - address_offset;
// stash the value that will be written or has just been read
- debug.cpu().set_wpinfo(address, data);
+ debug.cpu().set_wpinfo(address, data, size * unit_size);
// protect against recursion
debug.cpu().set_within_instruction(true);