Linux Applications Debugging Techniques/Core analysis

Basics
To obtain a good call stack, it is important that the gdb loads the same libraries that were loaded by the program that generated the core dump. If the machine we are analyzing the core has different libraries (or has them in different places) from the machine the core was dumped, then copy over the libraries to the analyzing machine, in a way that mirrors the dump machine. For instance:

At the gdb prompt:

analyze-cores
Here is a script that will generate a basic report per core file. Useful the days when cores are raining on you:

Canned user-defined commands
Same reporting functionality can be canned for gdb:

analyze-pid
A script that will generate a basic report and a core file for a running process:

Thread Local Storage
TLS data is rather difficult to access with gdb in the core files.