GSoC 2026 project adds native Fortran debugging support to LLDB
A Google Summer of Code 2026 project is upstreaming native Fortran language support into LLDB through a new TypeSystem, DWARF parser, and language plugin, enabling proper inspection of primitive types, arrays, pointers, and functions rather than just raw breakpoint resolution.
Summary
The LLVM debugger LLDB is gaining native Fortran support through a GSoC 2026 project that addresses a long-standing gap in the Flang ecosystem: while the Fortran compiler has matured, it lacked a capable dedicated debugger. Previously, LLDB could only resolve basic breakpoints via raw line tables when dealing with Fortran code. This project introduces a complete language backend comprising a DWARFASTParser for Fortran, a TypeSystemFortran for internal type representation, and a Fortran language plugin with pretty-printers and synthetic children providers.
The implementation currently covers primitive types (INTEGER, REAL, LOGICAL, COMPLEX), arrays, pointers, and functions. Array support is implemented through synthetic children to avoid intrusive core changes, while Fortran-specific behaviors like case insensitivity are handled via DWARF attributes (DW_AT_identifier_case) within the plugin boundary. The work is proceeding through LLVM's RFC process and is being upstreamed in incremental pull requests, with buildbot coverage planned for x86_64 and AArch64 to prevent regression.
Architecture and upstreaming approach
- DWARFASTParserFortran: Parses DW_TAG_base_type and related debug information to extract type metadata including symbol names, byte sizes, and layouts, then forwards constructed types to TypeSystemFortran for caching.
- TypeSystemFortran: Manages Fortran type lifetime and deduplication using unique pointers stored in a vector, with an LLVM FoldingSet to reuse existing type instances and prevent redundant allocations; tracks type name, byte size, and type kind for primitives.
- Language Plugin: Registers Fortran as a supported LLDB language and supplies language-specific pretty-printers, value formatters, and synthetic children providers, isolating Fortran-specific concerns like case insensitivity from core LLDB infrastructure.
- Testing Infrastructure: Uses lit-based testing at two levels—C++ unit tests (TypeSystemFortranTests, DWARFASTParserFortranTests, FortranLanguageTests) and Python SB API integration tests that compile sample Fortran programs and verify end-to-end debug session behavior.
- Upstreaming Strategy: Work was developed in a personal fork during RFC consensus-building (approximately two months), then decomposed into small, reviewable PRs; LLDB will not link directly to Flang at this stage due to build complexity, requiring only a Fortran compiler for test execution.
Why it matters
This work closes a critical tooling gap for the Flang Fortran compiler, which until now forced developers to rely on limited breakpoint debugging or alternative toolchains. For scientific computing and HPC practitioners on Linux—domains where Fortran remains dominant—the arrival of native LLDB support means a modern, scriptable debugger integrated with the broader LLVM ecosystem. The modular plugin architecture and decision to avoid Flang linkage at this stage also lowers the barrier for distribution packagers to enable and test the feature without pulling in heavy build dependencies.
Original reference: blog.llvm.org →