feat: support Rust value presentation#251
Open
swananan wants to merge 25 commits into
Open
Conversation
Recognize rustc &str layouts through the language-specific DWARF adapter and lower them into generic indirect-byte capture plans. Carry presentation metadata through the trace protocol, preserving lengths, embedded NUL bytes, and truncation status. Add Rust e2e coverage.
Resolve String identity from exact DWARF namespace ancestry and support legacy and current RawVec layouts without classifying user-defined lookalikes. Reuse UTF-8 semantic capture for default and raw formatting, including embedded separators and truncated payloads. Cover layout planning and output with Rust e2e fixtures.
Recover Vec element types from DWARF template parameters so RawVec layout changes do not leak into presentation. Capture only complete elements within event and memory limits, with semantic formatting and e2e coverage.
Recognize Rust shared and mutable slice fat pointers using the field convention maintained by rust-gdb. Derive element type, metadata widths, offsets, and stride from DWARF and cover analysis and runtime output.
Recognize only standard alloc namespace Box<str> types and validate their fat-pointer fields from DWARF. Reuse UTF-8 semantic capture and cover function parameters and empty values with runtime e2e.
Resolve Unix and Windows layouts through validated DWARF member paths, then preserve non-UTF-8 bytes with escaped byte-string rendering.
Recognize modern and legacy VecDeque layouts from DWARF and normalize ring-buffer segments into the existing semantic sequence payload. Reserve verifier headroom for the second bounded read and cover wrapped, empty, truncated, and zero-sized-element cases with e2e tests.
Use DWARF-derived projected member paths for legacy and generic NonZero layouts, including address-backed and direct values.
Project Cell contents from DWARF-derived member paths and preserve the rust-gdb wrapper display for scalar, aggregate, and zero-sized values.
Derive value and borrow-state projections from DWARF, then render shared and mutable borrow summaries through a language-neutral inline view.
Introduce DWARF-derived projected views for values assembled from multiple indirect reads. Use exact type identities, member offsets, and pointer widths to render Ref and RefMut guards without assuming private wrapper layouts. Cover analyzer lowering, eBPF error paths, namespace rejection, borrow states, tuples, and zero-sized referents with unit and runtime e2e tests.
Derive pointer and counter wrapper projections from DWARF so Rc and Arc remain compatible across Rust layout changes. Present public strong and weak counts without mutating captured payloads, and cover sized and zero-sized values in analyzer and runtime tests.
Recognize standard HashMap and HashSet values through namespace and version-specific RawTable shapes while deriving offsets, widths, and tuple fields from DWARF. Capture bounded control and bucket regions and format only occupied entries, including truncation, zero-sized values, and legacy hashbrown layouts.
Derive BTreeMap and BTreeSet node layouts from DWARF instead of tying capture to one compiler version. Capture a bounded, verifier-friendly node snapshot and reconstruct source order in user space. Cover leaf, internal, empty, zero-sized, truncated, malformed, and lookalike cases with unit and e2e tests.
swananan
force-pushed
the
feature/rust-value-presentation
branch
from
July 21, 2026 00:46
ef173da to
3dfa61b
Compare
Compile dependency-free fixtures with pinned Rust 1.49, 1.88, 1.93, and nightly toolchains so DWARF planning and representative runtime formatting are checked against real compiler output. Parse each target CU's rustc release from DW_AT_producer as an advisory candidate-ordering hint. Keep concrete type identity and layout validation as the source of truth. Accept the raw Ref and RefMut value pointer emitted by Rust 1.49 while retaining the one-member wrapper path used by newer compilers. CI requires every pinned toolchain; local runs skip unavailable versions.
swananan
force-pushed
the
feature/rust-value-presentation
branch
4 times, most recently
from
July 22, 2026 02:58
9c673e9 to
d75d897
Compare
Recognize the pre-hashbrown table from Rust DWARF. Capture its pointer-sized occupancy words and DWARF-aligned pair storage. Keep current hashbrown payloads backward compatible. Add pinned Rust 1.35 compatibility coverage and exercise map/set output in runtime e2e.
Resolve direct Root and raw parent pointer layouts from concrete DWARF while retaining Option-backed layouts used by newer Rust releases. Pin the Rust 1.35 plan and add runtime coverage for internal nodes, empty collections, and zero-sized entries.
Pin String, OsString, str, and Box<str> against Rust 1.35 DWARF. Exercise UTF-8, arbitrary OS bytes, empty values, embedded separators, and raw formats in runtime e2e. Share the standalone rustc invocation across pinned-toolchain fixtures.
Pin slice, Vec, and legacy tail/head VecDeque projections to the concrete DWARF emitted by Rust 1.35. Add runtime coverage for wrapped buffers, raw formatting, empty collections, and zero-sized elements. Promote Rust 1.35 into the shared planning and runtime compiler matrix now that every high-risk layout used by the matrix is covered.
Unify sized and slice-like DST handling for Rc and Arc through a DWARF-projected view. Keep sized pointees as values, but materialize the address of unsized trailing data with public strong and weak counts. Follow thin-pointer and explicit data_ptr/length DIE shapes without selecting on rustc version. Add pinned planning and runtime matrix coverage.
Derive PathBuf storage from its embedded OsString and only adapt &Path when DWARF exposes explicit pointer and length metadata. Preserve non-UTF-8 platform bytes and add pinned cross-version and runtime coverage.
Keep actionable type and DSL behavior in the scripting guide while leaving only support boundaries in the limitations and design contract.
Parse standard DWARF variant parts, selectors, and scoped enums so enum formatting follows target debug metadata instead of rustc layout assumptions. Preserve signed and unsigned scalar discriminants, including old rustc fixed-width encodings and the full u64 range. Cover payload, fieldless, niche-optimized, and univariant enums across pinned rustc versions.
Move Rust value read-plan construction and enum payload classification behind the source-language adapter. Keep the generic DWARF parser focused on physical type graphs, and make protocol formatting consume explicit language-neutral presentation metadata.
Cover mutable str, nested and repr(C) enums, pointer niches, and multi-field variant payloads in the pinned DWARF and runtime matrices. Add Rust 1.81 at the RawVec layout transition boundary.
swananan
force-pushed
the
feature/rust-value-presentation
branch
from
July 22, 2026 05:52
d75d897 to
97e54a3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing