Convert a minidump to a core file.
For a minidump from a 32-bit executable, use
For an ARM minidump, you have to work a little bit harder to get a core file. The easiest way is probably to do the conversion using qemu within your chroot.
# Convert minidump to a core file in /tmp/
First, setup the necessary files for the debugger. You need both the original executables and/or libraries whose symbols you wish to calculate, and you will need their corresponding debug information. Googlers: See Setup files for debugger for how to get these for official images.
Calculate the base address of the crashing executable's .text section.
You may also want to do this for shared libraries that the executable loaded.
Googlers: Alternatively, you can try my generate_gdb_command_file script to automatically generate a gdb command file for adding all the symbol files. For the "--top" command-line option, specify the path to where your image is mounted. Then, pass the path to the file to which you redirected minidump-2-core's stderr.
Run gdb on the core file.
Map executable's symbol file to base address of .text section.
Googlers: Alternatively, if you tried my generate_gdb_command_file script, use the generated gdb command file to add all the symbol files.
Sometimes, the gdb backtrace command (Use gdb to show a backtrace) doesn't show a stack trace any better than that of minidump_stackwalk (Use minidump_stackwalk to show a stack trace). If you think there's more to it than what those two are showing you, try this method to naively dump all the known symbol addresses seen on the stack. You'll see some false positives, but you may just find the name of a function that seems like a plausible place to look.
First, start from the above step of using gdb to show a backtrace. We can reuse the gdb command file that was generated for it. Googlers: If you didn't use my generate_gdb_command_file script, you can manually create the gdb command file containing any "add-symbol-file" commands you ran.
Second, determine the base address of the stack. The easiest way is to just look at the stack address in the minidump. This command will set the $sp_addr variable to the stack address of the first thread in the minidump:
If you want to be smarter, you can run minidump_stackwalk on the minidump (using the appropriate Breakpad symbols) and skip past any stack frames you can assume are accurate. You would do this by looking for the stack pointer of the last consecutive call frame found by "call frame info". For example, for issue http://crosbug.com/35531 the stack pointer value would be 0x7e8b3440 given the following top-most (i.e. higher address) frames:
Finally, run the following gdb command to dump 1024 words of the stack (i.e. potential addresses). In the output, for any value that corresponds to a known symbol, gdb will annotate it with the symbol's name in angle brackets. Knowing that, we can simply pipe the output to something (in this case, perl) to pull out any annotation it finds in the stack dump.