summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug/debugcmd.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2021-08-22 07:35:03 +1000
committer Vas Crabb <vas@vastheman.com>2021-08-22 08:12:00 +1000
commitad2f2f168d30755af9b47b5e09000a39d07b95d7 (patch)
tree59785c59d7c653a2338556c61d4b4b03228e369d /src/emu/debug/debugcmd.cpp
parent511c59003de8feb4622c30c6fd6382663a400c3d (diff)
Revert "Allow the bpset/wpset/rpset & map commands to act on any cpu, by prefixing the index or name with a # and passing as the first parameter. [smf]"
This reverts commit f4213dc209ebf2247f3c7e46f32d9bd2711bb374. The issue that the syntax used for this clashes with syntax for decimal numbers was never resolved.
Diffstat (limited to 'src/emu/debug/debugcmd.cpp')
-rw-r--r--src/emu/debug/debugcmd.cpp49
1 files changed, 22 insertions, 27 deletions
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp
index d4bb6724f8c..bd537935851 100644
--- a/src/emu/debug/debugcmd.cpp
+++ b/src/emu/debug/debugcmd.cpp
@@ -1461,23 +1461,22 @@ void debugger_commands::execute_bpset(int ref, const std::vector<std::string> &p
u64 address;
int bpnum;
const char *action = nullptr;
- int p = 0;
- /* CPU defaults to the active cpu */
- if (!validate_cpu_parameter((params[p][0] == '#') ? &params[p++][1] : nullptr, cpu))
+ /* CPU is implicit */
+ if (!validate_cpu_parameter(nullptr, cpu))
return;
/* param 1 is the address */
- if (!validate_number_parameter(params[p++], address))
+ if (!validate_number_parameter(params[0], address))
return;
/* param 2 is the condition */
parsed_expression condition(cpu->debug()->symtable());
- if (params.size() > p && !debug_command_parameter_expression(params[p++], condition))
+ if (params.size() > 1 && !debug_command_parameter_expression(params[1], condition))
return;
/* param 3 is the action */
- if (params.size() > p && !debug_command_parameter_command(action = params[p++].c_str()))
+ if (params.size() > 2 && !debug_command_parameter_command(action = params[2].c_str()))
return;
/* set the breakpoint */
@@ -1604,41 +1603,39 @@ void debugger_commands::execute_wpset(int ref, const std::vector<std::string> &p
u64 address, length;
read_or_write type;
int wpnum;
- int p = 0;
- /* CPU defaults to the active cpu */
- if (!validate_cpu_space_parameter((params[p][0] == '#') ? &params[p++][1] : nullptr, ref, space))
+ /* CPU is implicit */
+ if (!validate_cpu_space_parameter(nullptr, ref, space))
return;
/* param 1 is the address */
- if (!validate_number_parameter(params[p++], address))
+ if (!validate_number_parameter(params[0], address))
return;
/* param 2 is the length */
- if (!validate_number_parameter(params[p++], length))
+ if (!validate_number_parameter(params[1], length))
return;
/* param 3 is the type */
- if (!core_stricmp(params[p].c_str(), "r"))
+ if (!core_stricmp(params[2].c_str(), "r"))
type = read_or_write::READ;
- else if (!core_stricmp(params[p].c_str(), "w"))
+ else if (!core_stricmp(params[2].c_str(), "w"))
type = read_or_write::WRITE;
- else if (!core_stricmp(params[p].c_str(), "rw") || !core_stricmp(params[p].c_str(), "wr"))
+ else if (!core_stricmp(params[2].c_str(), "rw") || !core_stricmp(params[2].c_str(), "wr"))
type = read_or_write::READWRITE;
else
{
m_console.printf("Invalid watchpoint type: expected r, w, or rw\n");
return;
}
- p++;
/* param 4 is the condition */
parsed_expression condition(space->device().debug()->symtable());
- if (params.size() > p && !debug_command_parameter_expression(params[p++], condition))
+ if (params.size() > 3 && !debug_command_parameter_expression(params[3], condition))
return;
/* param 5 is the action */
- if (params.size() > p && !debug_command_parameter_command(action = params[p++].c_str()))
+ if (params.size() > 4 && !debug_command_parameter_command(action = params[4].c_str()))
return;
/* set the watchpoint */
@@ -1769,19 +1766,18 @@ void debugger_commands::execute_rpset(int ref, const std::vector<std::string> &p
device_t *cpu;
const char *action = nullptr;
int bpnum;
- int p = 0;
- /* CPU defaults to the active cpu */
- if (!validate_cpu_parameter((params[p][0] == '#') ? &params[p++][1] : nullptr, cpu))
+ /* CPU is implicit */
+ if (!validate_cpu_parameter(nullptr, cpu))
return;
/* param 1 is the condition */
parsed_expression condition(cpu->debug()->symtable());
- if (params.size() > p && !debug_command_parameter_expression(params[p], condition))
+ if (params.size() > 0 && !debug_command_parameter_expression(params[0], condition))
return;
/* param 2 is the action */
- if (params.size() > p && !debug_command_parameter_command(action = params[p].c_str()))
+ if (params.size() > 1 && !debug_command_parameter_command(action = params[1].c_str()))
return;
/* set the breakpoint */
@@ -3709,14 +3705,13 @@ void debugger_commands::execute_map(int ref, const std::vector<std::string> &par
offs_t taddress;
u64 address;
int intention;
- int p = 0;
- /* CPU defaults to the active cpu */
- if (!validate_cpu_space_parameter((params[p][0] == '#') ? &params[p++][1] : nullptr, ref, space))
+ /* validate parameters */
+ if (!validate_number_parameter(params[0], address))
return;
- /* validate parameters */
- if (!validate_number_parameter(params[p++], address))
+ /* CPU is implicit */
+ if (!validate_cpu_space_parameter(nullptr, ref, space))
return;
/* do the translation first */