code-yeongyu / code-yeongyu/c11-compiler-zig-omo

[Sisyphus] phase-3 / verify / Wave D — DWARF validator

Open
#30 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Scope
Validate that `.debug_*` sections produced by `zcc -g` structurally match those produced by `gcc -g`.

## Deliverables
- `phase3/scripts/dwarf-validate.sh` — script that:
1. Compiles the same source with `zcc -g` and `gcc -g`.
2. Runs `readelf --debug-dump=info,line,frame` (or `llvm-dwarfdump`) on both binaries.
3. Compares DIE counts, line program opcodes, and frame program structure.
4. Reports mismatches with severity (error vs warning).

## Success Criteria
1. `.debug_line` line programs for `phase1/c11-ref/*_test.c` have identical opcode sequences (same file:line mappings for every machine-code address).
2. `.debug_info` compilation unit and subprogram DIEs exist for every function; type DIEs exist for all basic C types.
3. `.debug_frame` / `.eh_frame` CFI records cover every function prologue.
4. No missing or extra DIEs compared to gcc baseline.

## Dependencies
- Phase 2 Wave 9 (DWARF generation) must be complete.
- Phase 2 Wave 10 (driver with `-g`) must be complete.

## Suggested Role Assignment
`dwarf-validator`

## Test Corpus Expectations
- All `phase1/c11-ref/*_test.c` files validated.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.