Skip to content

fix: prevent global fallback after DWARF lookup errors - #303

Merged
swananan merged 1 commit into
mainfrom
fix/typed-dwarf-lookup-errors
Sep 8, 2026
Merged

fix: prevent global fallback after DWARF lookup errors#303
swananan merged 1 commit into
mainfrom
fix/typed-dwarf-lookup-errors

Conversation

@swananan

@swananan swananan commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Local DWARF lookup errors could fall back to a same-named global, with diagnostic prefixes deciding which failures blocked fallback. Return typed unavailable, ambiguous, and query failures, and permit global fallback only when a successful local lookup reports no binding. Scalar and member access now propagate PC resolution and lookup errors.

Add selection tests for missing, unavailable, and ambiguous bindings, plus a compilation regression for scalar and member access at a PC without a DWARF function scope. The regression verifies that a failed local query is rejected even when a matching global exists, while valid global lookups still compile.

Validation completed on this patch:

  • cargo fmt --all
  • cargo clippy --all-targets --all-features -- -D warnings -D clippy::undocumented_unsafe_blocks
  • cargo test -p ghostscope-dwarf -p ghostscope-compiler --lib — 494 passed.
  • cargo test -p ghostscope-dwarf --test global_binding — 3 passed.
  • Full standard host → host e2e through runner job 29a33dfb2302 — 362 passed, exit 0, including the new regression.
  • Container topology e2e intentionally skipped because this change does not affect container or PID namespace behavior.

Return typed unavailable, ambiguous, and query failures from local variable
lookup. Allow global fallback only when a local lookup succeeds without a
binding, so diagnostic wording cannot change name resolution.

Apply the same rule to scalar and member access and add regression coverage
for missing, unavailable, ambiguous, and failed queries.
@swananan
swananan merged commit b94be70 into main Sep 8, 2026
10 checks passed
@swananan
swananan deleted the fix/typed-dwarf-lookup-errors branch September 8, 2026 13:49
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.

1 participant