From ad2f2f168d30755af9b47b5e09000a39d07b95d7 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 22 Aug 2021 07:35:03 +1000 Subject: 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. --- src/emu/debug/debugcmd.cpp | 49 +++++++++++++++++++++------------------------- 1 file 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 &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] == '#') ? ¶ms[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 &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] == '#') ? ¶ms[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 &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] == '#') ? ¶ms[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 &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] == '#') ? ¶ms[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 */ -- cgit v1.2.3