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 f4213dc209.

The issue that the syntax used for this clashes with syntax for decimal
numbers was never resolved.
This commit is contained in:
Vas Crabb 2021-08-22 07:35:03 +10:00
parent 511c59003d
commit ad2f2f168d

View File

@ -1461,23 +1461,22 @@ void debugger_commands::execute_bpset(int ref, const std::vector<std::string> &p
u64 address; u64 address;
int bpnum; int bpnum;
const char *action = nullptr; const char *action = nullptr;
int p = 0;
/* CPU defaults to the active cpu */ /* CPU is implicit */
if (!validate_cpu_parameter((params[p][0] == '#') ? &params[p++][1] : nullptr, cpu)) if (!validate_cpu_parameter(nullptr, cpu))
return; return;
/* param 1 is the address */ /* param 1 is the address */
if (!validate_number_parameter(params[p++], address)) if (!validate_number_parameter(params[0], address))
return; return;
/* param 2 is the condition */ /* param 2 is the condition */
parsed_expression condition(cpu->debug()->symtable()); 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; return;
/* param 3 is the action */ /* 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; return;
/* set the breakpoint */ /* set the breakpoint */
@ -1604,41 +1603,39 @@ void debugger_commands::execute_wpset(int ref, const std::vector<std::string> &p
u64 address, length; u64 address, length;
read_or_write type; read_or_write type;
int wpnum; int wpnum;
int p = 0;
/* CPU defaults to the active cpu */ /* CPU is implicit */
if (!validate_cpu_space_parameter((params[p][0] == '#') ? &params[p++][1] : nullptr, ref, space)) if (!validate_cpu_space_parameter(nullptr, ref, space))
return; return;
/* param 1 is the address */ /* param 1 is the address */
if (!validate_number_parameter(params[p++], address)) if (!validate_number_parameter(params[0], address))
return; return;
/* param 2 is the length */ /* param 2 is the length */
if (!validate_number_parameter(params[p++], length)) if (!validate_number_parameter(params[1], length))
return; return;
/* param 3 is the type */ /* 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; 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; 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; type = read_or_write::READWRITE;
else else
{ {
m_console.printf("Invalid watchpoint type: expected r, w, or rw\n"); m_console.printf("Invalid watchpoint type: expected r, w, or rw\n");
return; return;
} }
p++;
/* param 4 is the condition */ /* param 4 is the condition */
parsed_expression condition(space->device().debug()->symtable()); 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; return;
/* param 5 is the action */ /* 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; return;
/* set the watchpoint */ /* set the watchpoint */
@ -1769,19 +1766,18 @@ void debugger_commands::execute_rpset(int ref, const std::vector<std::string> &p
device_t *cpu; device_t *cpu;
const char *action = nullptr; const char *action = nullptr;
int bpnum; int bpnum;
int p = 0;
/* CPU defaults to the active cpu */ /* CPU is implicit */
if (!validate_cpu_parameter((params[p][0] == '#') ? &params[p++][1] : nullptr, cpu)) if (!validate_cpu_parameter(nullptr, cpu))
return; return;
/* param 1 is the condition */ /* param 1 is the condition */
parsed_expression condition(cpu->debug()->symtable()); 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; return;
/* param 2 is the action */ /* 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; return;
/* set the breakpoint */ /* set the breakpoint */
@ -3709,14 +3705,13 @@ void debugger_commands::execute_map(int ref, const std::vector<std::string> &par
offs_t taddress; offs_t taddress;
u64 address; u64 address;
int intention; 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))
return;
/* validate parameters */ /* validate parameters */
if (!validate_number_parameter(params[p++], address)) if (!validate_number_parameter(params[0], address))
return;
/* CPU is implicit */
if (!validate_cpu_space_parameter(nullptr, ref, space))
return; return;
/* do the translation first */ /* do the translation first */