From 6f6aca1b7f291fcd54893c1f9c206cb05f9bf64f Mon Sep 17 00:00:00 2001 From: AJR Date: Fri, 2 Sep 2022 21:08:24 -0400 Subject: Fix regressions in debugger trace command from d8d588262de1f11a529b208e470cff9b89a4cba6, including use-after-move issue --- src/emu/debug/debugcmd.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/emu/debug/debugcmd.cpp') diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp index 30ad53d762b..1e14db5b6df 100644 --- a/src/emu/debug/debugcmd.cpp +++ b/src/emu/debug/debugcmd.cpp @@ -3964,7 +3964,7 @@ void debugger_commands::execute_trace(const std::vector ¶m mode |= std::ios_base::trunc; f = std::make_unique(filename.c_str(), mode); - if (!f) + if (f->fail()) { m_console.printf("Error opening file '%s'\n", params[0]); return; @@ -3972,8 +3972,9 @@ void debugger_commands::execute_trace(const std::vector ¶m } // do it + bool const on(f); cpu->debug()->trace(std::move(f), trace_over, detect_loops, logerror, action); - if (f) + if (on) m_console.printf("Tracing CPU '%s' to file %s\n", cpu->tag(), filename); else m_console.printf("Stopped tracing on CPU '%s'\n", cpu->tag()); -- cgit v1.2.3