From 11ce4f0eded26fa9b0170c3c8c36c5111d44b5b4 Mon Sep 17 00:00:00 2001 From: AJR Date: Sat, 13 Feb 2021 14:31:35 -0500 Subject: Stop converting debugger console commands to all lowercase before parsing them. Case insensitivity has been preserved for command names, CPU and region tags and certain symbolic parameters (as well as expressions, which were treated as case-insensitive in other contexts), but filenames and character constants are no longer automatically lowercased. * debugcmd.cpp, debugcon.cpp: Remove some superfluous c_str() calls * debugcmd.cpp: Remove local member referencing debugger_cpu, which is accessed only rarely since the console now tracks the visible CPU --- src/emu/debug/debugcon.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/emu/debug/debugcon.cpp') diff --git a/src/emu/debug/debugcon.cpp b/src/emu/debug/debugcon.cpp index b282b000283..0eea46d5a6d 100644 --- a/src/emu/debug/debugcon.cpp +++ b/src/emu/debug/debugcon.cpp @@ -146,7 +146,7 @@ void debugger_console::execute_condump(int ref, const std::vector& mode = "w"; /* opening for append? */ - if ((filename[0] == '>') && (filename[1] == '>')) + if (filename.length() >= 2 && filename[0] == '>' && filename[1] == '>') { mode = "a"; filename = filename.substr(2); @@ -155,7 +155,7 @@ void debugger_console::execute_condump(int ref, const std::vector& FILE* f = fopen(filename.c_str(), mode); if (!f) { - printf("Error opening file '%s'\n", filename.c_str()); + printf("Error opening file '%s'\n", filename); return; } @@ -166,7 +166,7 @@ void debugger_console::execute_condump(int ref, const std::vector& } fclose(f); - printf("Wrote console contents to '%s'\n", filename.c_str()); + printf("Wrote console contents to '%s'\n", filename); } //------------------------------------------------- @@ -275,7 +275,7 @@ CMDERR debugger_console::internal_execute_command(bool execute, int params, char len = strlen(command); debug_command *found = nullptr; for (debug_command &cmd : m_commandlist) - if (!strncmp(command, cmd.command, len)) + if (!core_strnicmp(command, cmd.command, len)) { foundcount++; found = &cmd; @@ -363,7 +363,7 @@ CMDERR debugger_console::internal_parse_command(const std::string &original_comm case '+': if (parendex == 0 && paramcount == 1 && p[1] == '+') isexpr = true; *p = c; break; case '=': if (parendex == 0 && paramcount == 1) isexpr = true; *p = c; break; case 0: foundend = true; break; - default: *p = tolower(u8(c)); break; + default: *p = c; break; } } } @@ -419,7 +419,7 @@ CMDERR debugger_console::execute_command(const std::string &command, bool echo) { /* echo if requested */ if (echo) - printf(">%s\n", command.c_str()); + printf(">%s\n", command); /* parse and execute */ const CMDERR result = internal_parse_command(command, true); @@ -428,9 +428,9 @@ CMDERR debugger_console::execute_command(const std::string &command, bool echo) if (result.error_class() != CMDERR::NONE) { if (!echo) - printf(">%s\n", command.c_str()); + printf(">%s\n", command); printf(" %*s^\n", result.error_offset(), ""); - printf("%s\n", cmderr_to_string(result).c_str()); + printf("%s\n", cmderr_to_string(result)); } /* update all views */ -- cgit v1.2.3