Thursday, February 25, 2016

Where does wpdata get set in debugcpu

Hmmmm. Perusing emu/debug/debugcpu.cpp we find the elusive wpdata.


struct debugcpu_private
{
...

UINT64 wpdata;
UINT64 wpaddr;
UINT64 tempvar[NUM_TEMP_VARIABLES];

osd_ticks_t last_periodic_update_time;

bool comments_loaded;
};


//-------------------------------------------------
// watchpoint_check - check the watchpoints
// for a given CPU and address space
//-------------------------------------------------

void device_debug::watchpoint_check(address_space &space, int type, offs_t address, UINT64 value_to_write, UINT64 mem_mask)

...

// if we are a write watchpoint, stash the value that will be written
global->wpaddr = address;
if (type & WATCHPOINT_WRITE)
global->wpdata = value_to_write;

...

but there's no corresponding code to modify global->wpdata for WATCHPOINT_READ for just reading values so it doesn't get updated for reads.






No comments:

Post a Comment