trunk/src/emu/debug/debugcpu.c
| r21151 | r21152 | |
| 1649 | 1649 | m_stopirq(0), |
| 1650 | 1650 | m_stopexception(0), |
| 1651 | 1651 | m_endexectime(attotime::zero), |
| 1652 | m_total_cycles(0), |
| 1653 | m_last_total_cycles(0), |
| 1652 | 1654 | m_pc_history_index(0), |
| 1653 | 1655 | m_bplist(NULL), |
| 1654 | 1656 | m_trace(NULL), |
| r21151 | r21152 | |
| 1675 | 1677 | { |
| 1676 | 1678 | m_symtable.add("cycles", NULL, get_cycles); |
| 1677 | 1679 | m_symtable.add("totalcycles", NULL, get_totalcycles); |
| 1680 | m_symtable.add("lastinstructioncycles", NULL, get_lastinstructioncycles); |
| 1678 | 1681 | } |
| 1679 | 1682 | |
| 1680 | 1683 | // add entries to enable/disable unmap reporting for each space |
| r21151 | r21152 | |
| 1857 | 1860 | // update the history |
| 1858 | 1861 | m_pc_history[m_pc_history_index++ % HISTORY_SIZE] = curpc; |
| 1859 | 1862 | |
| 1863 | // update total cycles |
| 1864 | m_last_total_cycles = m_total_cycles; |
| 1865 | m_total_cycles = m_exec->total_cycles(); |
| 1866 | |
| 1860 | 1867 | // are we tracing? |
| 1861 | 1868 | if (m_trace != NULL) |
| 1862 | 1869 | m_trace->update(curpc); |
| r21151 | r21152 | |
| 3075 | 3082 | UINT64 device_debug::get_totalcycles(symbol_table &table, void *ref) |
| 3076 | 3083 | { |
| 3077 | 3084 | device_t *device = reinterpret_cast<device_t *>(table.globalref()); |
| 3078 | | return device->debug()->m_exec->total_cycles(); |
| 3085 | return device->debug()->m_total_cycles; |
| 3079 | 3086 | } |
| 3080 | 3087 | |
| 3081 | 3088 | |
| 3082 | 3089 | //------------------------------------------------- |
| 3090 | // get_lastinstructioncycles - getter callback for the |
| 3091 | // 'lastinstructioncycles' symbol |
| 3092 | //------------------------------------------------- |
| 3093 | |
| 3094 | UINT64 device_debug::get_lastinstructioncycles(symbol_table &table, void *ref) |
| 3095 | { |
| 3096 | device_t *device = reinterpret_cast<device_t *>(table.globalref()); |
| 3097 | device_debug *debug = device->debug(); |
| 3098 | return debug->m_total_cycles - debug->m_last_total_cycles; |
| 3099 | } |
| 3100 | |
| 3101 | |
| 3102 | //------------------------------------------------- |
| 3083 | 3103 | // get_logunmap - getter callback for the logumap |
| 3084 | 3104 | // symbols |
| 3085 | 3105 | //------------------------------------------------- |
trunk/src/emu/debug/debugcpu.h
| r21151 | r21152 | |
| 244 | 244 | static UINT64 get_current_pc(symbol_table &table, void *ref); |
| 245 | 245 | static UINT64 get_cycles(symbol_table &table, void *ref); |
| 246 | 246 | static UINT64 get_totalcycles(symbol_table &table, void *ref); |
| 247 | static UINT64 get_lastinstructioncycles(symbol_table &table, void *ref); |
| 247 | 248 | static UINT64 get_logunmap(symbol_table &table, void *ref); |
| 248 | 249 | static void set_logunmap(symbol_table &table, void *ref, UINT64 value); |
| 249 | 250 | static UINT64 get_state(symbol_table &table, void *ref); |
| r21151 | r21152 | |
| 275 | 276 | int m_stopirq; // stop IRQ number for DEBUG_FLAG_STOP_INTERRUPT |
| 276 | 277 | int m_stopexception; // stop exception number for DEBUG_FLAG_STOP_EXCEPTION |
| 277 | 278 | attotime m_endexectime; // ending time of the current execution |
| 279 | UINT64 m_total_cycles; // current total cycles |
| 280 | UINT64 m_last_total_cycles; // last total cycles |
| 278 | 281 | |
| 279 | 282 | // history |
| 280 | 283 | offs_t m_pc_history[HISTORY_SIZE]; // history of recent PCs |