summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug/debugcmd.cpp
diff options
context:
space:
mode:
author Nathan Woods <npwoods@mess.org>2017-01-16 07:59:32 -0500
committer Nathan Woods <npwoods@mess.org>2017-01-16 20:13:03 -0500
commitb8453021dfb819f3779eca37c87d7f2b215339ea (patch)
treec046265e1fe3f1607af4fef0aba6777060c44a4c /src/emu/debug/debugcmd.cpp
parentca11021d737b9e59291e8d74b60e0c8f64b4187e (diff)
Added a facility to allow logerror output to reside in traces
As a consequence, the debugger 'trace' command was changed so that the third parameter is a list of '|' delimited options
Diffstat (limited to 'src/emu/debug/debugcmd.cpp')
-rw-r--r--src/emu/debug/debugcmd.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp
index 5469670caa6..871dda1df22 100644
--- a/src/emu/debug/debugcmd.cpp
+++ b/src/emu/debug/debugcmd.cpp
@@ -2496,6 +2496,7 @@ void debugger_commands::execute_trace_internal(int ref, int params, const char *
{
const char *action = nullptr;
bool detect_loops = true;
+ bool logerror = false;
device_t *cpu;
FILE *f = nullptr;
const char *mode;
@@ -2507,8 +2508,25 @@ void debugger_commands::execute_trace_internal(int ref, int params, const char *
/* validate parameters */
if (!validate_cpu_parameter((params > 1) ? param[1] : nullptr, &cpu))
return;
- if (!validate_boolean_parameter((params > 2) ? param[2] : nullptr, &detect_loops))
- return;
+ if (params > 2)
+ {
+ std::stringstream stream;
+ stream.str(param[2]);
+
+ std::string flag;
+ while (std::getline(stream, flag, '|'))
+ {
+ if (!core_stricmp(flag.c_str(), "noloop"))
+ detect_loops = false;
+ else if (!core_stricmp(flag.c_str(), "logerror"))
+ logerror = true;
+ else
+ {
+ m_console.printf("Invalid flag '%s'\n", flag.c_str());
+ return;
+ }
+ }
+ }
if (!debug_command_parameter_command(action = (params > 3) ? param[3] : nullptr))
return;
@@ -2533,7 +2551,7 @@ void debugger_commands::execute_trace_internal(int ref, int params, const char *
}
/* do it */
- cpu->debug()->trace(f, trace_over, detect_loops, action);
+ cpu->debug()->trace(f, trace_over, detect_loops, logerror, action);
if (f)
m_console.printf("Tracing CPU '%s' to file %s\n", cpu->tag(), filename.c_str());
else