[lldb-dev] exitting from batch processing

René J.V. Bertin via lldb-dev lldb-dev at lists.llvm.org
Fri Mar 10 06:36:53 PST 2017


Hi,

I'm working on a crash reporter tool that invokes and controls lldb through a batchfile. As described (http://stackoverflow.com/questions/26267289/how-can-i-exit-lldb-after-running-commands-with-o) it is tricky to get older lldb versions to exit cleanly because they don't react as they should to the quit command. Sadly this concerns the "system" lldb version shipped with Apple's dev. tools for at least OS X 10.9 .

The stackoverflow page describes a hack using a python script, which works, but which evidently requires a python interpreter to be integrated with lldb.

Supposing it is still possible to build lldb without python, what happens when it is called this way?

%> lldb -p <pid> -o bt -o continue -o detach -o "script import os ; os._exit(0)" -o quit

Errors in the python script (e.g. import os2) don't interrupt the batch processing and lldb will quit because of the subsequent "quit" command. But what if python isn't available?

Thanks,

R.



More information about the lldb-dev mailing list