binutils Newspaper
JUNE 15, 2026
binutils/dwarf Proposed

Binutils/dwarf: Print embedded source, when available

This patch adds support for printing embedded source code from DWARFv5 debugging information using objdump.

Will Hawkins proposes a patch to enhance objdump to print embedded source code directly from DWARFv5 debugging information. The patch modifies dwarf.c, adds a new test case, and updates the testsuite. This allows developers to view the original source code embedded within the binary, which can be helpful for debugging and analysis.

In Details

This patch adds support for the DW_LNCT_source line number entry type in DWARFv5, which allows embedding source code directly in the debugging information. The patch modifies binutils/dwarf.c to handle this new entry type and adds a test case in binutils/testsuite/binutils-all/dw5-embedded-source.S and .d to verify the functionality. This is useful in environments where the original source files are not readily available.

For Context

DWARF (Debugging With Attributed Records Format) is a debugging data format used by compilers and debuggers to provide information about the source code location of machine code instructions. This patch extends the objdump utility to extract and display source code embedded within the DWARF debugging information, providing a more complete debugging experience.

Filed Under: binutilsdwarfdebuggingobjdumpembedded source