core_dump_internals.rst 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. :orphan:
  2. Anatomy of core dump image
  3. --------------------------
  4. Core dump component can be configured to use old legacy binary format or the new ELF one. The ELF format is recommended for new designs. It provides more information about the CPU and memory state of a program at the moment when panic handler is entered.
  5. The memory state embeds a snapshot of all tasks mapped in the memory space of the program. The CPU state contains register values when the core dump has been generated. Core dump file uses a subset of the ELF structures to register these information.
  6. Loadable ELF segments are used for the memory state of the process while ELF notes (ELF.PT_NOTE) are used for process metadata (pid, registers, signal, ...). Especially, the CPU status is stored in a note with a special name and type (``CORE``, ``NT_PRSTATUS type``).
  7. Here is an overview of coredump layout:
  8. .. figure:: ../../_static/core_dump_format_elf.png
  9. :align: center
  10. :alt: Core dump image format
  11. :figclass: align-center
  12. Core dump ELF image format
  13. .. figure:: ../../_static/core_dump_format_bin.png
  14. :align: center
  15. :alt: Core dump binary image format
  16. :figclass: align-center
  17. Core dump binary image format
  18. Note: The format of image file showed on the above pictures represents current version of image and can be changed in future releases.
  19. Overview of implementation
  20. --------------------------
  21. The figure below describes some basic aspects related to implementation of core dump:
  22. .. figure:: ../../_static/core_dump_impl.png
  23. :align: center
  24. :alt: Core dump implementation overview
  25. :figclass: align-center
  26. Core dump implementation overview
  27. Note: The diagram above hide some details and represents current implementation of the core dump and can be changed later.