swift-dwarf

0.1.0

🐞 A Swift library for parsing binary files to obtain DWARF information.
p-x9/swift-dwarf

What's New

0.1.0

2025-12-27T13:19:40Z

What's Changed

  • Add CI workflow configuration for macOS and Linux builds by @p-x9 in #1

New Contributors

  • @p-x9 made their first contribution in #1

Full Changelog: https://github.com/p-x9/swift-dwarf/commits/0.1.0

swift-dwarf

A Swift library for parsing binary files to obtain DWARF information.

Note

Currently, only mach-o binaries are supported. (MachOKit)

Support for ELF binaries will also be added in the future. (ELFKit)

Github issues Github forks Github stars Github top language

Usage

Basic

DWARF information from binary file (MachOFile) can be retrieved via the dwarf property.

import MachOKit
import DWARF

// string table in `.debug_str` section
let strings = machO.dwarf.strings

// abbreviations tables in `.debug_abbrev` section
let abbreviationSets = machO.dwarf.abbreviationsSets

// compiration units in `.debug_info` section
let compirationUnits = machO.dwarf.compilationUnits
/* ... */

DWARFMachOPrintTests.swift provides test cases that generate output similar to dwarfdump. Please use these as a reference.

Status

Supported Binary formats

  • mach-o
  • ELF

Supported DWARF sections

  • .debug_abbrev
  • .debug_info
  • .debug_line
  • .debug_str
  • .debug_line_str
  • .debug_str_offs
  • .debug_addr
  • .debug_aranges
  • .debug_rnglists
  • .debug_loclists
  • .debug_names
  • .debug-macro
  • .debug-pubnames
  • .debug-pubtypes
  • .debug-ranges

License

swift-dwarf is released under the MIT License. See LICENSE

Description

  • Swift Tools 6.0.0
View More Packages from this Author

Dependencies

Last updated: Wed Apr 22 2026 13:45:56 GMT-0900 (Hawaii-Aleutian Daylight Time)