-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stabilize debugger_visualizer #108668
Stabilize debugger_visualizer #108668
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @oli-obk (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
Do we have any documentation for this feature yet? The tracking issue links to https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#documentation-prs for the next step. cc @wesleywiser what's the status of this feature? Any unresolved questions still open? |
I created a PR for documentation here: rust-lang/reference#1335 I'll be removing the 'draft' state shortly. |
tests/debuginfo/auxiliary/dependency-with-embedded-visualizers.rs
Outdated
Show resolved
Hide resolved
I keep reading the RFC & the docs, and I keep thinking that we can do much better than natvis. I have written extensive debugger visualizers back in my C# days, where the visualizations had to be done mostly as code. If we adapt natvis, many modern Rust developers will have a major XML cringe every time they would think about it - and that just means far fewer implementations. I don't mind XML being stored inside PDBs - out of sight, out of mind, but the developers implementing visualizations should not be aware of it / write it / store it in a repo. Instead, I believe we should provide absolute minimum needed support in the compiler, and let crates define the needed attributes/macros to generate (natvis?) internally. Or is this the intention all along? |
@nyurik Do you see writing GDB pretty printers as a reasonable alternative to Natvis? This might be the preferred means of embedding visualizations for crate owners less familiar with Natvis. The intention of this feature is to allow crate owners to specify their own visualizations (Natvis if they'd like to support WinDbg/Visual Studio users, Python if they'd like to support GDB users) to be embedded in their crate's debug binary. This allows crate consumers to visualize a crate's custom types without any manual configuration on their part. This achieves "out of sight, out of mind" from the end-user's perspective. As far as supporting visualization development via macros or some other form of source embedding, I think this falls under "V2" of debugger_visualizer. This extension would probably require a new set of design discussions. (See rust-lang/rfcs#3191 (comment) for a bit more info.) By stabilizing the current state of debugger_visualizer, the feature can begin adding value to the community while possible extensions are specced out. We have already contributed Natvis definitions to some popular crates (servo/rust-smallvec#286 and Lokathor/tinyvec#167, for example). |
Hi @gibbyfree, would you mind rebasing this PR and removing the merge commits? We prefer not to have merge commits in the PR history as it makes the final merge history messier. Feel free to ping me if |
0b2cfc5
to
c9653a6
Compare
Thanks! @bors r+ rollup |
…zer, r=wesleywiser Stabilize debugger_visualizer This stabilizes the `debugger_visualizer` attribute (rust-lang#95939). * Marks the `debugger_visualizer` feature as `accepted`. * Marks the `debugger_visualizer` attribute as `ungated`. * Deletes feature gate test, removes feature gate from other tests. Closes rust-lang#95939
Rollup of 7 pull requests Successful merges: - rust-lang#105076 (Refactor core::char::EscapeDefault and co. structures) - rust-lang#108161 (Add `ConstParamTy` trait) - rust-lang#108668 (Stabilize debugger_visualizer) - rust-lang#110512 (Fix elaboration with associated type bounds) - rust-lang#110895 (Remove `all` in target_thread_local cfg) - rust-lang#110955 (uplift `clippy::clone_double_ref` as `suspicious_double_ref_op`) - rust-lang#111048 (Mark`feature(return_position_impl_trait_in_trait)` and`feature(async_fn_in_trait)` as not incomplete) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This stabilizes the
debugger_visualizer
attribute (#95939).debugger_visualizer
feature asaccepted
.debugger_visualizer
attribute asungated
.Closes #95939