summaryrefslogtreecommitdiffstats
path: root/src/emu/debug/debugcmd.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2021-08-15 12:22:58 -0400
committer AJR <ajrhacker@users.noreply.github.com>2021-08-15 12:31:55 -0400
commit57ddc51b52f53cc33bfe810beb5f38dabf73ab85 (patch)
treeb6df3225d3af9ffa78da92199d19f02150bb535d /src/emu/debug/debugcmd.cpp
parent2cc894b9fe23c3b53de3ea84edb77b3518fab6bb (diff)
Debugger-related feature removals and cleanup
- Remove the hotspot read tracker. This was never robustly implemented, but changes to the memory system made it much less useful, and the "speedup opportunities" which it aimed to determine are not very important from a current emulation standpoint. - Remove the CURSP/GENSP state symbol and the generic sp() getter. Stacking semantics vary too much between CPU architectures for this to be of much use. (A "SP" symbol has been added to a few CPU cores whose stack pointers were otherwise not being registered.) - Remove the cached pointer to device_state_interface and the state() fast accessor from device_t. Most users of device_state_interface either already had a pointer to the specific CPU device type or needed to check first for the presence of the interface. - Change the PC memory write tracker to use pcbase(), which works even when the instruction callback is masked out, instead of peeking at the PC history index. - Remove some obsolete watchpoint-related definitions from machine.h.
Diffstat (limited to 'src/emu/debug/debugcmd.cpp')
-rw-r--r--src/emu/debug/debugcmd.cpp56
1 files changed, 9 insertions, 47 deletions
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp
index ace535f1084..d4bb6724f8c 100644
--- a/src/emu/debug/debugcmd.cpp
+++ b/src/emu/debug/debugcmd.cpp
@@ -225,8 +225,6 @@ debugger_commands::debugger_commands(running_machine& machine, debugger_cpu& cpu
m_console.register_command("rpenable", CMDFLAG_NONE, 1, 0, 1, std::bind(&debugger_commands::execute_rpdisenable, this, _1, _2));
m_console.register_command("rplist", CMDFLAG_NONE, 0, 0, 0, std::bind(&debugger_commands::execute_rplist, this, _1, _2));
- m_console.register_command("hotspot", CMDFLAG_NONE, 0, 0, 3, std::bind(&debugger_commands::execute_hotspot, this, _1, _2));
-
m_console.register_command("statesave", CMDFLAG_NONE, 0, 1, 1, std::bind(&debugger_commands::execute_statesave, this, _1, _2));
m_console.register_command("ss", CMDFLAG_NONE, 0, 1, 1, std::bind(&debugger_commands::execute_statesave, this, _1, _2));
m_console.register_command("stateload", CMDFLAG_NONE, 0, 1, 1, std::bind(&debugger_commands::execute_stateload, this, _1, _2));
@@ -1342,7 +1340,7 @@ void debugger_commands::execute_cpulist(int ref, const std::vector<std::string>
int index = 0;
for (device_execute_interface &exec : execute_interface_enumerator(m_machine.root_device()))
{
- device_state_interface *state;
+ const device_state_interface *state;
if (exec.device().interface(state) && state->state_find_entry(STATE_GENPCBASE) != nullptr)
m_console.printf("[%s%d] %s\n", &exec.device() == m_console.get_visible_cpu() ? "*" : "", index++, exec.device().tag());
}
@@ -1896,49 +1894,6 @@ void debugger_commands::execute_rplist(int ref, const std::vector<std::string> &
/*-------------------------------------------------
- execute_hotspot - execute the hotspot
- command
--------------------------------------------------*/
-
-void debugger_commands::execute_hotspot(int ref, const std::vector<std::string> &params)
-{
- /* if no params, and there are live hotspots, clear them */
- if (params.empty())
- {
- bool cleared = false;
-
- /* loop over CPUs and find live spots */
- for (device_t &device : device_enumerator(m_machine.root_device()))
- if (device.debug()->hotspot_tracking_enabled())
- {
- device.debug()->hotspot_track(0, 0);
- m_console.printf("Cleared hotspot tracking on CPU '%s'\n", device.tag());
- cleared = true;
- }
-
- /* if we cleared, we're done */
- if (cleared)
- return;
- }
-
- /* extract parameters */
- device_t *device = nullptr;
- if (!validate_cpu_parameter(!params.empty() ? params[0].c_str() : nullptr, device))
- return;
- u64 count = 64;
- if (params.size() > 1 && !validate_number_parameter(params[1], count))
- return;
- u64 threshhold = 250;
- if (params.size() > 2 && !validate_number_parameter(params[2], threshhold))
- return;
-
- /* attempt to install */
- device->debug()->hotspot_track(count, threshhold);
- m_console.printf("Now tracking hotspots on CPU '%s' using %d slots with a threshold of %d\n", device->tag(), (int)count, (int)threshhold);
-}
-
-
-/*-------------------------------------------------
execute_statesave - execute the statesave command
-------------------------------------------------*/
@@ -3559,6 +3514,13 @@ void debugger_commands::execute_trackpc(int ref, const std::vector<std::string>
if (!validate_cpu_parameter((params.size() > 1) ? params[1].c_str() : nullptr, cpu))
return;
+ const device_state_interface *state;
+ if (!cpu->interface(state))
+ {
+ m_console.printf("Device has no PC to be tracked\n");
+ return;
+ }
+
// Should we clear the existing data?
bool clear = false;
if (params.size() > 2 && !validate_boolean_parameter(params[2], clear))
@@ -3570,7 +3532,7 @@ void debugger_commands::execute_trackpc(int ref, const std::vector<std::string>
// Insert current pc
if (m_console.get_visible_cpu() == cpu)
{
- const offs_t pc = cpu->state().pcbase();
+ const offs_t pc = state->pcbase();
cpu->debug()->set_track_pc_visited(pc);
}
m_console.printf("PC tracking enabled\n");