Durin 是一个用于读取和写入 Dwarf 调试格式的库。
Durin is a library for reading and writing the Dwarf debugging format

原始链接: https://github.com/tmcgilchrist/durin

Durin 是一个用于读取和写入矮人调试格式的库。它的目标是支持:读取 ELF 和 MachO 目标文件中的 DWARF 5 编码信息。将 DWARF 5 信息写入 ELF 和 MachO 目标文件。将 DWARF 5 信息写入汇编文件。未来它可能支持 DWARF 4 或更新版本的 DWARF 标准。它应该提供:跨平台:durin 对您使用的目标文件类型不做任何假设。提供您自己的缓冲区或使用对象库。延迟:您可以迭代编译单元,而无需解析其内容。仅解析您迭代的调试信息条目 (DIE) 树。durin 还使用 DW_AT_sibling 引用,在可能的情况下避免解析 DIE 的子项以查找其下一个兄弟节点。要将 durin 作为依赖项安装,请运行:并将 durin 添加到您的项目的 dune-project 或 *.opam 文件中。文档在 ocaml.org 上。示例程序在 example 目录中。

## Durin:一个新的DWARF调试格式库 一个名为Durin的新库,使用OCaml编写,旨在读取和写入DWARF调试格式。作者创建它的目的是深入理解DWARF 5,支持OCaml编译器工具,并构建一个定制的OCaml调试器。虽然目前没有专注于性能——预计它会比`gimli-rs`等成熟的库慢——但Durin *完全* 支持DWARF 5,包括`gimli-rs`目前缺乏的`debug_info`部分。 开发正在进行中,当前的工作重点是读取支持、调用帧信息和DWARF表达式求值。作者对现有调试器在这些领域的工具表示不满。 讨论强调了DWARF令人惊讶的图灵完备性以及格式内存在各种求值器。分享的资源包括一本推荐的关于构建调试器的书以及一个关于DWARF格式潜在滥用的演讲。该项目目前正在进行中,尚未发布到OPAM,需要源码编译才能进行测试。
相关文章

原文

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.

To install durin as a dependency, run:

And add durin to your project's dune-project or *.opam files.

  • Documentation on ocaml.org
  • Example programs in example directory
联系我们 contact @ memedata.com