.debug_info

Introduction

[edit]

The .debug_info section of an ELF contains information generated by compilers to describe the source code while debugging by keeping symbols and its type, scope, file, line number, etc. The .debug_info[1] section is one of the main components of DWARF[2][3] debug info files.[4] This is generated by a compiler when -g switch or its variants are used.

Other debug ELF sections

[edit]
Section Name Description
.debug_types Contains the non-trivial types. Stored as a hash structure so that duplicate type definition can be removed easily.
.debug_str Contains strings that are not placed in the .debug_info and .debug_types sections. The linker merges the string tables to eliminate duplicates.
.debug_aranges Contain range lists to define what pieces of a program's text belong to which subprograms and compilation units.
.debug_loc Contain lists of expressions that describe to the debugger the location of a variable based on the PC value.
.debug_line Contain a description of the mapping from PC values to source locations.
.debug_abbrev Provide the definitions for abbreviation codes used in describing the debug info in the .debug_info and .debug_types sections.
.debug_pubnames Is an index to help fetching of symbol debug information without having to scan object files.
.debug_pubtypes Is an index to help fetching of type information.

References

[edit]
  1. ^ "Debugging Options (Using the GNU Compiler Collection (GCC))". gcc.gnu.org.
  2. ^ "Dwarf Extensions". gcc.gnu.org.
  3. ^ You, Ilsun; Youn, Taek-Young (2023-02-03). Information Security Applications: 23rd International Conference, WISA 2022, Jeju Island, South Korea, August 24–26, 2022, Revised Selected Papers. Springer Nature. ISBN 978-3-031-25659-2.
  4. ^ "ELF section retrieval with debuginfod". www.redhat.com. Retrieved 2023-09-25.