Adding "totalcycles" debugger variable

This commit is contained in:
Nathan Woods 2011-12-29 12:21:45 +00:00
parent 229df6131a
commit 8bfeccfb66
2 changed files with 17 additions and 1 deletions

View File

@ -1691,9 +1691,12 @@ device_debug::device_debug(device_t &device)
// set up state-related stuff
if (m_state != NULL)
{
// add a global symbol for the current instruction pointer
// add global symbol for cycles and totalcycles
if (m_exec != NULL)
{
m_symtable.add("cycles", NULL, get_cycles);
m_symtable.add("totalcycles", NULL, get_totalcycles);
}
// add entries to enable/disable unmap reporting for each space
if (m_memory != NULL)
@ -3082,6 +3085,18 @@ UINT64 device_debug::get_cycles(symbol_table &table, void *ref)
}
//-------------------------------------------------
// get_totalcycles - getter callback for the
// 'totalcycles' symbol
//-------------------------------------------------
UINT64 device_debug::get_totalcycles(symbol_table &table, void *ref)
{
device_t *device = reinterpret_cast<device_t *>(table.globalref());
return device->debug()->m_exec->total_cycles();
}
//-------------------------------------------------
// get_logunmap - getter callback for the logumap
// symbols

View File

@ -243,6 +243,7 @@ private:
// symbol get/set callbacks
static UINT64 get_current_pc(symbol_table &table, void *ref);
static UINT64 get_cycles(symbol_table &table, void *ref);
static UINT64 get_totalcycles(symbol_table &table, void *ref);
static UINT64 get_logunmap(symbol_table &table, void *ref);
static void set_logunmap(symbol_table &table, void *ref, UINT64 value);
static UINT64 get_state(symbol_table &table, void *ref);