-
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
Tracking Issue for #[collapse_debuginfo]
#100758
Comments
Some conclusions from discussing #118903 with @azhogin:
|
…uginfo.rs, r=petrochenkov Improved support of collapse_debuginfo attribute for macroses. Added walk_chain_collapsed function to consider collapse_debuginfo attribute in parent macroses in call chain. Fixed collapse_debuginfo attribute processing for cranelift (there was if/else branches error swap). Enabled attribute by default for builtin and core/std macroses. cc rust-lang#100758
…uginfo.rs, r=petrochenkov Improved support of collapse_debuginfo attribute for macros. Added walk_chain_collapsed function to consider collapse_debuginfo attribute in parent macros in call chain. Fixed collapse_debuginfo attribute processing for cranelift (there was if/else branches error swap). cc rust-lang#100758
…uginfo.rs, r=petrochenkov Improved support of collapse_debuginfo attribute for macros. Added walk_chain_collapsed function to consider collapse_debuginfo attribute in parent macros in call chain. Fixed collapse_debuginfo attribute processing for cranelift (there was if/else branches error swap). cc rust-lang#100758
…ebuginfo.rs, r=petrochenkov Improved support of collapse_debuginfo attribute for macros. Added walk_chain_collapsed function to consider collapse_debuginfo attribute in parent macros in call chain. Fixed collapse_debuginfo attribute processing for cranelift (there was if/else branches error swap). cc rust-lang#100758
…ebuginfo.rs, r=petrochenkov Improved support of collapse_debuginfo attribute for macros. Added walk_chain_collapsed function to consider collapse_debuginfo attribute in parent macros in call chain. Fixed collapse_debuginfo attribute processing for cranelift (there was if/else branches error swap). cc rust-lang#100758
…ebuginfo.rs, r=petrochenkov Improved support of collapse_debuginfo attribute for macros. Added walk_chain_collapsed function to consider collapse_debuginfo attribute in parent macros in call chain. Fixed collapse_debuginfo attribute processing for cranelift (there was if/else branches error swap). cc rust-lang#100758
…ebuginfo.rs, r=petrochenkov Improved support of collapse_debuginfo attribute for macros. Added walk_chain_collapsed function to consider collapse_debuginfo attribute in parent macros in call chain. Fixed collapse_debuginfo attribute processing for cranelift (there was if/else branches error swap). cc rust-lang#100758
Rollup merge of rust-lang#118903 - azhogin:azhogin/skip_second_stmt_debuginfo.rs, r=petrochenkov Improved support of collapse_debuginfo attribute for macros. Added walk_chain_collapsed function to consider collapse_debuginfo attribute in parent macros in call chain. Fixed collapse_debuginfo attribute processing for cranelift (there was if/else branches error swap). cc rust-lang#100758
…_improved_attr, r=petrochenkov Improved collapse_debuginfo attribute, added command-line flag Improved attribute collapse_debuginfo with variants: `#[collapse_debuginfo=(no|external|yes)]`. Added command-line flag for default behaviour. Work-in-progress: will add more tests. cc rust-lang#100758
…_improved_attr, r=petrochenkov Improved collapse_debuginfo attribute, added command-line flag Improved attribute collapse_debuginfo with variants: `#[collapse_debuginfo=(no|external|yes)]`. Added command-line flag for default behaviour. Work-in-progress: will add more tests. cc rust-lang#100758
Rollup merge of rust-lang#119828 - azhogin:azhogin/collapse_debuginfo_improved_attr, r=petrochenkov Improved collapse_debuginfo attribute, added command-line flag Improved attribute collapse_debuginfo with variants: `#[collapse_debuginfo=(no|external|yes)]`. Added command-line flag for default behaviour. Work-in-progress: will add more tests. cc rust-lang#100758
…_attr, r=petrochenkov Improved collapse_debuginfo attribute, added command-line flag Improved attribute collapse_debuginfo with variants: `#[collapse_debuginfo=(no|external|yes)]`. Added command-line flag for default behaviour. Work-in-progress: will add more tests. cc rust-lang/rust#100758
…rs, r=petrochenkov Improved support of collapse_debuginfo attribute for macros. Added walk_chain_collapsed function to consider collapse_debuginfo attribute in parent macros in call chain. Fixed collapse_debuginfo attribute processing for cranelift (there was if/else branches error swap). cc rust-lang/rust#100758
I think we need to stabilize the In any case, I'll try to stabilize |
First of all, none of these features ( dsl! {
some();
macro();
taking();
multiline();
input();
and();
processing();
it();
in();
some();
way();
} If the macro preserves the input spans in its generated code, then we'll just go through input lines in the order in which they exist in the generated code. The macro generate_code() {
some();
generated();
code();
}
generate_code!(); |
Debugging scenarios for code with macros. Definitions
The end binary
In all scenarios the focus crate may depend on other crates, including standard library. How can options be passed if necessary
General assumptionsVery few people are going to care about debugging and add As a result we should probably default on the side of revealing more information, i.e. not collapsing, so that manual uncollapsing with editing or rebuilding with If something is uncollapsed undesirably, there's a universal way to deal with it - set a breakpoint after the macro call and Macros defined in the crate of focusWe probably want to uncollapse such macros by default, to side on revealing more. The crate of focus is typically editable, so we can usually temporarily add Macro defined outside of the crate of focusOne special case of this is the standard library. Default behavior for other crates defining macros is probably the main question of this stabilization. The crate of focus can always be rebuilt with Note that macro-only crates are always external (that includes proc macro crates). When we start debugging non-macro code in a different crate, macros defined in that crate become local. Procedural macrosProc macros may actually have locations pointing to their definition (generated by Other heuristicsWe can use other heuristics for (un)collapsing macros by default, besides extern-ness, but I cannot think of any good ones.
Macros used to avoid boilerplate and code duplication seem to be the primary candidates for uncollapsing, such macros are more likely to be local and tailored for specific tasks, but otherwise I don't see good and simple heuristics for detecting them. |
Basically, I suggest choosing |
From what I read (unless I am mistaken), the stabilization of I am saying this because #95152 and the theoretical applicability of |
debuginfo: Stabilize `-Z debug-macros`, `-Z collapse-macro-debuginfo` and `#[collapse_debuginfo]` `-Z debug-macros` is "stabilized" by enabling it by default and removing. `-Z collapse-macro-debuginfo` is stabilized as `-C collapse-macro-debuginfo`. It now supports all typical boolean values (`parse_opt_bool`) in addition to just yes/no. Default value of `collapse_debuginfo` was changed from `false` to `external` (i.e. collapsed if external, not collapsed if local) - rust-lang#100758 (comment) describes some debugging scenarios that motivate this default as reasonable. `#[collapse_debuginfo]` attribute without a value is no longer supported to avoid guessing the default. Closes rust-lang#100758 Closes rust-lang#41743 Closes rust-lang#39153 TODO: Stabilization report
debuginfo: Stabilize `-Z debug-macros`, `-Z collapse-macro-debuginfo` and `#[collapse_debuginfo]` `-Z debug-macros` is "stabilized" by enabling it by default and removing. `-Z collapse-macro-debuginfo` is stabilized as `-C collapse-macro-debuginfo`. It now supports all typical boolean values (`parse_opt_bool`) in addition to just yes/no. Default value of `collapse_debuginfo` was changed from `false` to `external` (i.e. collapsed if external, not collapsed if local) - rust-lang#100758 (comment) describes some debugging scenarios that motivate this default as reasonable. `#[collapse_debuginfo]` attribute without a value is no longer supported to avoid guessing the default. Stabilization report: rust-lang#120845 (comment) Closes rust-lang#100758 Closes rust-lang#41743 Closes rust-lang#39153
debuginfo: Stabilize `-Z debug-macros`, `-Z collapse-macro-debuginfo` and `#[collapse_debuginfo]` `-Z debug-macros` is "stabilized" by enabling it by default and removing. `-Z collapse-macro-debuginfo` is stabilized as `-C collapse-macro-debuginfo`. It now supports all typical boolean values (`parse_opt_bool`) in addition to just yes/no. Default value of `collapse_debuginfo` was changed from `false` to `external` (i.e. collapsed if external, not collapsed if local) - rust-lang/rust#100758 (comment) describes some debugging scenarios that motivate this default as reasonable. `#[collapse_debuginfo]` attribute without a value is no longer supported to avoid guessing the default. Stabilization report: rust-lang/rust#120845 (comment) Closes rust-lang/rust#100758 Closes rust-lang/rust#41743 Closes rust-lang/rust#39153
This is a tracking issue for the
#[collapse_debuginfo]
attribute (rust-lang/compiler-team#386).The feature gate for the issue is
#![feature(collapse_debuginfo)]
.About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
#[collapse_debuginfo]
#99556)Unresolved Questions
#[track_caller]
- Code in block passed to macro has line number of macro invocation #39153 (comment)Implementation history
#[collapse_debuginfo]
#99556.The text was updated successfully, but these errors were encountered: