Having reproduced an elusive bug that crashes my app (running inside the iOS simulator, to be precise), I want to generate a core file for inspection later. On Linux I would run generate-core-file from within gdb, but that command isn’t available in the Mac OS X version of gdb.
So, how can I generate a core file from within gdb? There are ways to ask the OS for a core dump of a crashed app, but I fear the app will change some of its state by then. What’s the best way to do this?
Thanks!
Unfortunate there is no gcore command in mac osx gdb, but there is a good article about how to generate core dump on osx
Link
In this article there is a downloadable source code to generate core dump, which I have used many times.