Debugging exit() (or other function) calls in stand-alone app; can we somehow backtrace this?

We have a rather extensive oF 008 / OS X application, using a number of addons et cetera, which every now and then executes a clean exit() while we did not expect or request it.

This only happens with the stand-alone version, after running alright for a long while. It might be our own code, or an addon, but so far we have no way of figuring out which piece of code is causing the exit.

Because the deployment Mac is not eligible for the latest XCode, we can not test the application using breakpoints and don’t get any further than logging the fact that the function is called, and the app executes a clean shut-down.

So I would like to be able to log a complete stacktrace right before exit() finishes up. Does anybody know how to achieve this?

Thanks!

can you add a breakpoint (and debug it) via command line?

https://developer.apple.com/library/mac/documentation/IDEs/Conceptual/gdb_to_lldb_transition_guide/document/lldb-terminal-workflow-tutorial.html

I have very little experience with this but this seems promising.

Thanks for your suggestion @zach! If I understand correctly this would require us to build the project from source using LLDB, am I right? I’m a bit unclear as to how to do this.

Anyhow, in a very recent change of events (arrival of the new MacPro!) we no longer have to use the old machine without XCode. And with that urgency out of the way and our deadline in sight, I don’t think we will do any more research into this right now. Thread might still be useful for others so I’ll just keep it here.