LmCast :: Stay tuned in

Durin is a library for reading and writing the Dwarf debugging format

Recorded: Dec. 2, 2025, 3:04 a.m.

Original Summarized

GitHub - tmcgilchrist/durin: Durin is a library for reading and writing the Dwarf debugging format

Skip to content

Navigation Menu

Toggle navigation

Sign in

Appearance settings

PlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub SparkBuild and deploy intelligent appsGitHub ModelsManage and compare promptsMCP RegistryNewIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityAcceleratorArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricing

Search or jump to...

Search code, repositories, users, issues, pull requests...

Search

Clear

Search syntax tips

Provide feedback


We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.
You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

tmcgilchrist

/

durin

Public

Notifications
You must be signed in to change notification settings

Fork
0

Star
42

Durin is a library for reading and writing the Dwarf debugging format

License

BSD-3-Clause license

42
stars

0
forks

Branches

Tags

Activity

Star

Notifications
You must be signed in to change notification settings

Code

Issues
1

Pull requests
2

Actions

Security

Uh oh!

There was an error while loading. Please reload this page.


Insights

Additional navigation options

Code

Issues

Pull requests

Actions

Security

Insights

tmcgilchrist/durin

 masterBranchesTagsGo to fileCodeOpen more actions menuFolders and filesNameNameLast commit messageLast commit dateLatest commit History59 Commits.github.github  docdoc  exampleexample  liblib  testtest  .gitignore.gitignore  .ocamlformat.ocamlformat  LICENSELICENSE  README.mdREADME.md  dune-projectdune-project  durin.opamdurin.opam  durin.opam.templatedurin.opam.template  View all filesRepository files navigationREADMEBSD-3-Clause licenseDurin
Durin is a library for reading and writing the Dwarf debugging format.
It aims to support:

Reading DWARF 5 encoded information from ELF and MachO object files.
Writing DWARF 5 information into ELF and MachO object files.
Writing DWARF 5 information into assembly files.

In future it could support DWARF 4 or newer versions of the DWARF standard.
It should provide:

Cross-platform: durin makes no assumptions about what kind of object file
you're working with. Provide your own Buffer or use the object library.
Lazy: you can iterate compilation units without parsing their contents.
Parse only as many debugging information entry (DIE) trees as you iterate
over. durin also uses DW_AT_sibling references to avoid parsing a DIE's
children to find it's next sibling where possible.

Install
To install durin as a dependency, run:
$ opam install durin
And add durin to your project's dune-project or *.opam files.
Documentation

Documentation on ocaml.org
Example programs in example directory

A simple .debug_info parser
A simple .debug_line parser
A dwarfdump clone
An addr2line clone
A small utility dwprod to list the compilers
used to create each compilation unit within a shared library or
executable (via DW_AT_producer).
A dwarf-valiate clone, a program to
validate the integrity of some DWARF information and the references
between sections and compilation units.

Resources

Apple Compact Unwinding Format is defined by the LLVM implementation.

https://github.com/llvm/llvm-project/blob/main/libunwind/include/mach-o/compact_unwind_encoding.h
https://faultlore.com/blah/compact-unwinding/
https://github.com/getsentry/symbolic/blob/master/symbolic-debuginfo/src/macho/compact.rs

Vendor extensions from GCC
https://sourceware.org/elfutils/DwarfExtensions

About

Durin is a library for reading and writing the Dwarf debugging format

Resources

Readme

License

BSD-3-Clause license

Uh oh!

There was an error while loading. Please reload this page.


Activity
Stars

42
stars
Watchers

1
watching
Forks

0
forks

Report repository

Releases
No releases published

Packages
0

No packages published

Languages

OCaml
98.0%

Standard ML
0.7%

Raku
0.5%

C
0.3%

Perl
0.3%

C++
0.1%

Dune
0.1%

Footer

© 2025 GitHub, Inc.

Footer navigation

Terms

Privacy

Security

Status

Community

Docs

Contact

Manage cookies

Do not share my personal information

You can’t perform that action at this time.

Durin is a library developed by tmcgilchrist designed for reading and writing the Dwarf debugging format, specifically targeting DWARF 5. The core objective of the project is to provide a versatile tool for handling debugging information embedded within ELF and MachO object files, as well as assembly files. The library aims to achieve cross-platform functionality, making it adaptable to various object file formats without imposing specific assumptions. A key design principle is “laziness,” enabling developers to iterate through compilation units without immediately parsing their complete contents, minimizing computational overhead. To further optimize parsing efficiency, Durin leverages DW_AT_sibling references to avoid redundant traversal and repeated parsing of DIE (debugging information entry) children when locating sibling entries.

Installation of Durin is achieved through the OPAM package manager: `$ opam install durin`. Integration with projects requires the addition of durin to the project’s `dune-project` file or `.opam` files. Documentation supporting the library’s usage is available on ocaml.org, alongside example programs found within the `example` directory. These examples demonstrate practical applications, including a simple `.debug_info` parser, a `.debug_line` parser, a clone of the `dwarfdump` utility, an `addr2line` clone, a utility named `dwprod` to identify compilers used to generate compilation units within shared libraries or executables (using DW_AT_producer), and a “dwarf-validate” clone to ensure the integrity of DWARF-related data and references.

The project relies on resources such as the Apple Compact Unwinding Format, defined within the LLVM implementation, alongside references and documentation from sites like faultlore.com, which provides information pertaining to Compact Unwinding Format. Additionally, the library incorporates vendor extensions provided by GCC, documented at sourceware.org/elfutils, offering additional capabilities and support.

The primary focus of Durin is to provide a robust and efficient means for parsing and manipulating DWARF debugging information, aiming to facilitate debugging and understanding of compiled code.