binutils Newspaper
JUNE 15, 2026
binutils/dwarf Proposed

binutils/dwarf: Print embedded source, when available

Extends objdump to print embedded source code from DWARFv5 debug information, if present.

This patch modifies objdump to extract and print embedded source code stored in DWARFv5 debugging information. The patch iterates on previous versions by fixing issues such as incorrect bitwise operations, formatting problems, scoping issues, and test case compatibility. This enhancement allows developers to view the original source code directly from the disassembled object file, which simplifies debugging and reverse engineering, especially when source files are missing.

In Details

DWARFv5 allows embedding source code directly within the debugging information. This patch modifies binutils/dwarf.c to recognize and display the DW_LNCT_source and DW_LNCT_LLVM_source content types in the line number program tables. The primary file is binutils/dwarf.c, with test cases in binutils/testsuite/binutils-all/. This feature is useful when the original source files are unavailable.

For Context

DWARF (Debugging With Attributed Record Formats) is a standard used by debuggers to locate variables, functions, and source code lines within a compiled binary. It bridges the gap between compiled code and the original source code, making debugging possible. The objdump utility displays various information from object files, including disassembled code and debugging information. This patch enhances objdump to extract and display source code embedded directly within the DWARF debugging information, which can be useful when the original source files are not readily accessible.

Filed Under: binutilsdwarfobjdumpdebuggingembedded source