Skip to content

Addr2line enhance 4#4976

Merged
lum1n0us merged 1 commit into
bytecodealliance:mainfrom
TianlongLiang:addr2line_enhance_4
Jul 16, 2026
Merged

Addr2line enhance 4#4976
lum1n0us merged 1 commit into
bytecodealliance:mainfrom
TianlongLiang:addr2line_enhance_4

Conversation

@TianlongLiang

Copy link
Copy Markdown
Contributor

No description provided.

New test suite at test-tools/addr2line/tests/ exercising addr2line.py
against purpose-built C/C++ sources covering the interval-table
overlay contract and the tool's other behaviors:

- Baseline single-function resolution
- Inline expansion (always_inline, 4-level deep chain)
- Cross-TU LTO inlining (multi-file recursion + wasm-opt -Oz -g,
  which exercises both LLVM outermost-name failure modes)
- Trap inside loop body (DWARF line-table edge case)
- Multi-frame call stack
- C++ symbol demangling
- AOT mode offset math
- fast-interp / --no-addr fallbacks
- offset=0 fallback (trap at function entry)
- Empty input
- Skip-guard invariant on build_subprogram_intervals
  (test_build_subprogram_intervals_filters_invalid_dies): rejects
  DW_AT_declaration=true DIEs, low_pc == 0 (wasm-opt DCE ghosts),
  and high_pc <= low_pc entries at parse time.

Layout:
  test-tools/addr2line/tests/
  ├── README.md              -- documentation
  ├── conftest.py            -- pytest fixtures (sdk discovery, build,
  │                            run_addr2line invocation, multi-sdk
  │                            parametrization)
  ├── test_addr2line.py      -- 12 test cases
  ├── pytest.ini             -- marker definitions (slow, multi_sdk)
  ├── run_tests.sh           -- thin pytest wrapper
  ├── apps/                  -- 8 purpose-built C/C++ sources
  └── fixtures/              -- 3 plaintext call-stack inputs

Sources under apps/ are NOT copied from samples/; they target specific
edge cases independent of sample evolution.

Multi-SDK mode (--multi-sdk) parametrizes build-based tests over every
detected wasi-sdk under /opt to catch DWARF-encoding differences
between clang versions.

Depends on the addr2line.py refactor.

@lum1n0us lum1n0us left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lum1n0us
lum1n0us merged commit d002f81 into bytecodealliance:main Jul 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants