dwarf2pdb produces an executable that converts DWARF-embedded executables into stripped executables with separate PDB debug files:
Input: DWARF-embedded executable (ELF/PE with embedded DWARF debug info) Output: Stripped executable + separate PDB file
This enables Windows debugging tools to work with executables originally compiled with DWARF debug information.
Test Driven Development (TDD) is the core methodology:
- Write tests first - Define expected behavior through tests before implementation
- Implement minimally - Write just enough code to make tests pass
- Refactor - Clean up code while maintaining test coverage
- Iterate - Repeat for each feature, maintaining full test coverage
All new features must follow the TDD cycle: red (failing test) → green (passing test) → refactor.
- Source:
src/by domain —ir/,dwarf/,pdb/,pipeline/,util/. - CLI:
dwarf_pdb_converterbuilt fromsrc/main.cppintobuild/. - Tests: unit
ut/, integrationit/, systemst/(binaries inbuild/test/). - Docs:
README.md,TEST_STRUCTURE.md,NODES.md,DWARF5_PDB_MATCH.md; user guides indoc/. Scripts inscript/.
- Configure:
cmake -S . -B build(add-DCMAKE_BUILD_TYPE=Debugif single-config). - Build:
cmake --build build -j(MSVC: optionally--config Debug). - Run tests:
ctest --test-dir build --output-on-failure. - Run suites directly:
build/test/ut_tests,build/test/it_dwarf_tests,build/test/it_pdb_tests,build/test/st_tests. - Run CLI:
build/dwarf_pdb_converter --help(may bebuild/Debug/...on multi-config). - Windows env:
script\setup_msvc_env.bat; tool/libs download viascript/download_tool_libs.cmake.
- C++17, 4-space indent, no tabs. Headers
.h, sources.cpp. - Naming: Classes
PascalCase(e.g.,DwarfReader), functionscamelCase, constants/macrosUPPER_SNAKE_CASE, namespaces lowercase. - Respect module boundaries; avoid cyclic deps. Keep headers minimal and documented where non-obvious.
- Three-layer pipeline: DWARF ↔ IR ↔ PDB (
src/ir,src/dwarf,src/pdb). - IR owns canonical IDs; never reuse DWARF offsets or PDB type indices as identities. Use
IRTypeTable+IRMapsfor bijections. - Utilities in
src/util/Compare.*support deep round-trip checks.
- Tests mirror CLAUDE.md and
TEST_STRUCTURE.md(ut/it/st). Name filestest_*.cppnear their suite. - Keep tests deterministic; write round-trip coverage for new features. Run with
ctestor suite binaries.
- One logical change per commit; imperative subject (≤72 chars). Example:
Add IR mapping for LF_UNION. - PRs: focused description, linked issues, and
ctestoutput. Update docs/tests when behavior or interfaces change.