diff options
author | 2022-09-02 21:08:24 -0400 | |
---|---|---|
committer | 2022-09-02 21:08:24 -0400 | |
commit | 6f6aca1b7f291fcd54893c1f9c206cb05f9bf64f (patch) | |
tree | 95c8cc0cd92eaf031f657bd4a475f311e0faa106 | |
parent | 184f4dcfa2c445f5fa90364ec24537e1c6e2e555 (diff) |
Fix regressions in debugger trace command from d8d588262de1f11a529b208e470cff9b89a4cba6, including use-after-move issue
-rw-r--r-- | src/emu/debug/debugcmd.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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<std::string_view> ¶m mode |= std::ios_base::trunc; f = std::make_unique<std::ofstream>(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<std::string_view> ¶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()); |