[lldb] Don't use ::exit but instead return from the driver loop (NFC)
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 10 Nov 2020 00:36:47 +0000 (16:36 -0800)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 10 Nov 2020 00:47:30 +0000 (16:47 -0800)
commit0ca90eb3350b9e8c606fdf1ca0496e0bf3e330ec
tree655fc2f08c9ebee316e1203cd0e84083f136bc77
parent6ac12b5b6c5dc2c705f6e638cf6f5d50118abe92
[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.
lldb/tools/driver/Driver.cpp