mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-19 01:09:39 +00:00
[lldb] Don't use ::exit but instead return from the driver loop (NFC)
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.
This commit is contained in:
parent
6ac12b5b6c
commit
0ca90eb335
@ -593,7 +593,7 @@ int Driver::MainLoop() {
|
||||
|
||||
if (commands_file == nullptr) {
|
||||
// We should have already printed an error in PrepareCommandsForSourcing.
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
m_debugger.SetInputFileHandle(commands_file, true);
|
||||
@ -621,7 +621,7 @@ int Driver::MainLoop() {
|
||||
// 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 &&
|
||||
@ -646,7 +646,7 @@ int Driver::MainLoop() {
|
||||
if (m_option_data.m_batch &&
|
||||
local_results.GetResult() ==
|
||||
lldb::eCommandInterpreterResultCommandError)
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
m_debugger.SetAsync(old_async);
|
||||
|
Loading…
x
Reference in New Issue
Block a user