src/emu/debug/debugcpu.c
| r10344 | r10345 | |
| 91 | 91 | bool debugger_access; |
| 92 | 92 | |
| 93 | 93 | int execution_state; |
| 94 | device_t * m_stop_when_not_device; // stop execution when the device ceases to be this |
| 94 | 95 | |
| 95 | 96 | UINT32 bpindex; |
| 96 | 97 | UINT32 wpindex; |
| r10344 | r10345 | |
| 1093 | 1094 | /* loop over CPUs and reset the transient flags */ |
| 1094 | 1095 | for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next()) |
| 1095 | 1096 | device->debug()->reset_transient_flag(); |
| 1097 | machine.debugcpu_data->m_stop_when_not_device = NULL; |
| 1096 | 1098 | } |
| 1097 | 1099 | |
| 1098 | 1100 | |
| r10344 | r10345 | |
| 1749 | 1751 | assert(global->livecpu == NULL); |
| 1750 | 1752 | global->livecpu = &m_device; |
| 1751 | 1753 | |
| 1754 | // if we're a new device, stop now |
| 1755 | if (global->m_stop_when_not_device != NULL && global->m_stop_when_not_device != &m_device) |
| 1756 | { |
| 1757 | global->m_stop_when_not_device = NULL; |
| 1758 | global->execution_state = EXECUTION_STATE_STOPPED; |
| 1759 | reset_transient_flags(*m_device.machine); |
| 1760 | } |
| 1761 | |
| 1752 | 1762 | // update the target execution end time |
| 1753 | 1763 | m_endexectime = endtime; |
| 1754 | 1764 | |
| r10344 | r10345 | |
| 1804 | 1814 | |
| 1805 | 1815 | assert(global->livecpu == &m_device); |
| 1806 | 1816 | |
| 1807 | | // if we're stopping on a context switch, handle it now |
| 1808 | | if (m_flags & DEBUG_FLAG_STOP_CONTEXT) |
| 1809 | | { |
| 1810 | | global->execution_state = EXECUTION_STATE_STOPPED; |
| 1811 | | reset_transient_flags(*m_device.machine); |
| 1812 | | } |
| 1813 | | |
| 1814 | 1817 | // clear the live CPU |
| 1815 | 1818 | global->livecpu = NULL; |
| 1816 | 1819 | } |
| r10344 | r10345 | |
| 2239 | 2242 | |
| 2240 | 2243 | assert(m_exec != NULL); |
| 2241 | 2244 | |
| 2242 | | m_flags |= DEBUG_FLAG_STOP_CONTEXT; |
| 2245 | global->m_stop_when_not_device = &m_device; |
| 2243 | 2246 | global->execution_state = EXECUTION_STATE_RUNNING; |
| 2244 | 2247 | } |
| 2245 | 2248 | |
src/emu/debug/debugcpu.h
| r10344 | r10345 | |
| 349 | 349 | static const UINT32 DEBUG_FLAG_STEPPING_OVER = 0x00000040; // CPU is stepping over a function |
| 350 | 350 | static const UINT32 DEBUG_FLAG_STEPPING_OUT = 0x00000080; // CPU is stepping out of a function |
| 351 | 351 | static const UINT32 DEBUG_FLAG_STOP_PC = 0x00000100; // there is a pending stop at cpu->breakpc |
| 352 | | static const UINT32 DEBUG_FLAG_STOP_CONTEXT = 0x00000200; // there is a pending stop on next context switch |
| 353 | 352 | static const UINT32 DEBUG_FLAG_STOP_INTERRUPT = 0x00000400; // there is a pending stop on the next interrupt |
| 354 | 353 | static const UINT32 DEBUG_FLAG_STOP_EXCEPTION = 0x00000800; // there is a pending stop on the next exception |
| 355 | 354 | static const UINT32 DEBUG_FLAG_STOP_VBLANK = 0x00001000; // there is a pending stop on the next VBLANK |
| r10344 | r10345 | |
| 358 | 357 | |
| 359 | 358 | static const UINT32 DEBUG_FLAG_STEPPING_ANY = DEBUG_FLAG_STEPPING | DEBUG_FLAG_STEPPING_OVER | DEBUG_FLAG_STEPPING_OUT; |
| 360 | 359 | static const UINT32 DEBUG_FLAG_TRACING_ANY = DEBUG_FLAG_TRACING | DEBUG_FLAG_TRACING_OVER; |
| 361 | | static const UINT32 DEBUG_FLAG_TRANSIENT = DEBUG_FLAG_STEPPING_ANY | DEBUG_FLAG_STOP_PC | DEBUG_FLAG_STOP_CONTEXT | |
| 360 | static const UINT32 DEBUG_FLAG_TRANSIENT = DEBUG_FLAG_STEPPING_ANY | DEBUG_FLAG_STOP_PC | |
| 362 | 361 | DEBUG_FLAG_STOP_INTERRUPT | DEBUG_FLAG_STOP_EXCEPTION | DEBUG_FLAG_STOP_VBLANK | DEBUG_FLAG_STOP_TIME; |
| 363 | 362 | }; |
| 364 | 363 | |