To analyze coredumps, the Memfault UI offers a slew of analyses right in the browser, such as full backtraces for all threads, viewers for local, static and global variables and more.
In some cases, it might be desirable to debug a coredump locally, using GDB. Memfault also supports this use case, by offering the option to export a coredump to an ELF core file which can be loaded into GDB.
This guide explains how to use this feature.
- A version of GDB that is capable of loading ELF core files. When GDB is built
...-elf-linuxtarget, this support is included. If you do not have (a capable) GDB installed yet, see the section at the bottom for installation instructions.
Navigate to the Issue and specific (coredump) trace that you would like to export and expand the "Download" drop down menu. If the menu is not present, it most likely means that the trace was not a coredump trace.
Click "Coredump .elf" to export and download the coredump to an ELF core file:
Aside of the ELF core file, GDB also needs debug information about the software that generated the coredump, in order to make sense of the data in the core file. This debug information is present in the symbol ELF file. Note that the symbol file MUST match the software that generated the coredump.
To download the symbol file, expand the "Download" drop down menu again. Click "Symbols .elf" to download the symbol file.
You can load the core & symbol files as part of the GDB command line invocation like this:
If your version of GDB does not have support for core files, you will see this message when attempting to load the file:
Memfault provides GDB binaries that do have support for core files. See section at the bottom for installation instructions.
In case GDB is already running, it's also possible to load core & (additional) symbol files using GDB commands:
To view what files have been loaded, you can use the
info files command:
Create a file
environment.yml with these contents:
Run this command to install GDB and the dependencies from the
By default, "memfault-multi-arch-gdb" is used as the name for the environment.
You can override this by passing
-n <NAME> to the "create" command.
To activate the Conda environment in your current shell, just run:
This commands adds
gdb to your shell's
Once activated, you can run