This fixes a reproducer test failure that was caused by the undefined
order in which global destructors run. More concretely, the static
instance of the RealFileSystem had been destroyed before we finalized
the reproducer, which uses it to copy files into the reproducer. By
exiting normally, we call SBDebugger::Terminate and finalize the
reproducer before any static dtors are run.
if (commands_file == nullptr) {
// We should have already printed an error in PrepareCommandsForSourcing.
- exit(1);
+ return 1;
}
m_debugger.SetInputFileHandle(commands_file, true);
// non-zero exit status.
if (m_option_data.m_batch &&
results.GetResult() == lldb::eCommandInterpreterResultCommandError)
- exit(1);
+ return 1;
if (m_option_data.m_batch &&
results.GetResult() == lldb::eCommandInterpreterResultInferiorCrash &&
if (m_option_data.m_batch &&
local_results.GetResult() ==
lldb::eCommandInterpreterResultCommandError)
- exit(1);
+ return 1;
}
}
m_debugger.SetAsync(old_async);