summaryrefslogtreecommitdiffstats
path: root/src/emu/debug/debugcpu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/debug/debugcpu.cpp')
-rw-r--r--src/emu/debug/debugcpu.cpp91
1 files changed, 1 insertions, 90 deletions
diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp
index cf1d8eb5318..1399a6b8ec2 100644
--- a/src/emu/debug/debugcpu.cpp
+++ b/src/emu/debug/debugcpu.cpp
@@ -439,7 +439,6 @@ device_debug::device_debug(device_t &device)
, m_triggered_breakpoint(nullptr)
, m_triggered_watchpoint(nullptr)
, m_trace(nullptr)
- , m_hotspot_threshhold(0)
, m_track_pc_set()
, m_track_pc(false)
, m_comment_set()
@@ -458,7 +457,6 @@ device_debug::device_debug(device_t &device)
// set up notifiers and clear the passthrough handlers
if (m_memory) {
int count = m_memory->max_space_count();
- m_phr.resize(count, nullptr);
m_phw.resize(count, nullptr);
for (int i=0; i != count; i++)
if (m_memory->has_space(i)) {
@@ -552,7 +550,7 @@ device_debug::~device_debug()
void device_debug::write_tracking(address_space &space, offs_t address, u64 data)
{
- dasm_memory_access const newAccess(space.spacenum(), address, data, history_pc(0));
+ dasm_memory_access const newAccess(space.spacenum(), address, data, m_state->pcbase());
std::pair<std::set<dasm_memory_access>::iterator, bool> trackedAccess = m_track_mem_set.insert(newAccess);
if (!trackedAccess.second)
trackedAccess.first->m_pc = newAccess.m_pc;
@@ -561,19 +559,6 @@ void device_debug::write_tracking(address_space &space, offs_t address, u64 data
void device_debug::reinstall(address_space &space, read_or_write mode)
{
int id = space.spacenum();
- if (u32(mode) & u32(read_or_write::READ))
- {
- if (m_phr[id])
- m_phr[id]->remove();
- if (!m_hotspots.empty())
- switch (space.data_width())
- {
- case 8: m_phr[id] = space.install_read_tap(0, space.addrmask(), "hotspot", [this, &space](offs_t address, u8 &, u8 ) { hotspot_check(space, address); }, m_phr[id]); break;
- case 16: m_phr[id] = space.install_read_tap(0, space.addrmask(), "hotspot", [this, &space](offs_t address, u16 &, u16) { hotspot_check(space, address); }, m_phr[id]); break;
- case 32: m_phr[id] = space.install_read_tap(0, space.addrmask(), "hotspot", [this, &space](offs_t address, u32 &, u32) { hotspot_check(space, address); }, m_phr[id]); break;
- case 64: m_phr[id] = space.install_read_tap(0, space.addrmask(), "hotspot", [this, &space](offs_t address, u64 &, u64) { hotspot_check(space, address); }, m_phr[id]); break;
- }
- }
if (u32(mode) & u32(read_or_write::WRITE))
{
if (m_phw[id])
@@ -1348,30 +1333,6 @@ void device_debug::registerpoint_enable_all(bool enable)
//-------------------------------------------------
-// hotspot_track - enable/disable tracking of
-// hotspots
-//-------------------------------------------------
-
-void device_debug::hotspot_track(int numspots, int threshhold)
-{
- // if we already have tracking enabled, kill it
- m_hotspots.clear();
-
- // only start tracking if we have a non-zero count
- if (numspots > 0)
- {
- // allocate memory for hotspots
- m_hotspots.resize(numspots);
- memset(&m_hotspots[0], 0xff, numspots*sizeof(m_hotspots[0]));
-
- // fill in the info
- m_hotspot_threshhold = threshhold;
- }
- reinstall_all(read_or_write::READ);
-}
-
-
-//-------------------------------------------------
// history_pc - return an entry from the PC
// history
//-------------------------------------------------
@@ -1749,56 +1710,6 @@ void device_debug::breakpoint_check(offs_t pc)
}
-//-------------------------------------------------
-// watchpoint_check - check the watchpoints
-// for a given CPU and address space
-//-------------------------------------------------
-
-//-------------------------------------------------
-// hotspot_check - check for hotspots on a
-// memory read access
-//-------------------------------------------------
-
-void device_debug::hotspot_check(address_space &space, offs_t address)
-{
- offs_t curpc = m_device.state().pcbase();
-
- // see if we have a match in our list
- unsigned int hotindex;
- for (hotindex = 0; hotindex < m_hotspots.size(); hotindex++)
- if (m_hotspots[hotindex].m_access == address && m_hotspots[hotindex].m_pc == curpc && m_hotspots[hotindex].m_space == &space)
- break;
-
- // if we didn't find any, make a new entry
- if (hotindex == m_hotspots.size())
- {
- // if the bottom of the list is over the threshold, print it
- hotspot_entry &spot = m_hotspots[m_hotspots.size() - 1];
- if (spot.m_count > m_hotspot_threshhold)
- m_device.machine().debugger().console().printf("Hotspot @ %s %08X (PC=%08X) hit %d times (fell off bottom)\n", space.name(), spot.m_access, spot.m_pc, spot.m_count);
-
- // move everything else down and insert this one at the top
- memmove(&m_hotspots[1], &m_hotspots[0], sizeof(m_hotspots[0]) * (m_hotspots.size() - 1));
- m_hotspots[0].m_access = address;
- m_hotspots[0].m_pc = curpc;
- m_hotspots[0].m_space = &space;
- m_hotspots[0].m_count = 1;
- }
-
- // if we did find one, increase the count and move it to the top
- else
- {
- m_hotspots[hotindex].m_count++;
- if (hotindex != 0)
- {
- hotspot_entry temp = m_hotspots[hotindex];
- memmove(&m_hotspots[1], &m_hotspots[0], sizeof(m_hotspots[0]) * hotindex);
- m_hotspots[0] = temp;
- }
- }
-}
-
-
//**************************************************************************
// TRACER