As the title says:
What exactly is a core file and why is it useful?
I know when one is generated by UNIX, and I know how to check for one. I’m aware they’re useful for debugging… but I’m not entirely sure what it contains so I’m not sure why its useful!
A core file is, essentially, a dump of the memory and registers of the program at the time that it crashed. When viewed in a debugger, you can get information on where the program was at the time of the crash, as well as getting stack traces or viewing the state of heap memory. Basically it lets you do anything you could with a debugger attached at the time of the crash, short of actually running code.