Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a memory dump of a Mac OS Application

How can I create a memory dump of a process under Mac OS? --> dump all occupied memory of a process into a file for analysis.

like image 220
wachschaf Avatar asked Feb 25 '18 12:02

wachschaf


People also ask

How do I enable core dumping on my Mac?

Core dumps are disabled by default. To enable core dumps on a MacOS machine of version 10.4 and higher create the file, /etc/launchd. conf. Next, restart the machine and reproduce the issue to collect the core dump file.


1 Answers

You might need to disable system integrity protection for this to work - beware that this is a security risk and you should re-enable after you are done.

  • restart into Recovery Mode,
  • csrutil disable via the terminal
  • restart

In your new session, run 'top', find your process ID.

lldb --attach-pid <PID>
process save-core "filename"

Restart into recovery, and reenable system integrity protection.

like image 166
deefunkt Avatar answered Sep 24 '22 22:09

deefunkt