debuginfo: slices are DW_TAG_array_type's#153238
Conversation
|
r? @davidtwco rustbot has assigned @davidtwco. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
another relevant thread from gdb bugtracker about rust's weird unsized type debug info and some related fixes in gdb: https://sourceware.org/bugzilla/show_bug.cgi?id=30330 . The type of change here (changing slice types to be array types with no count, similar to C's VLA/FMA) was discussed but I guess never implemented in rustc? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@rustbot ready |
|
@bors r+ |
debuginfo: slices are DW_TAG_array_type's Rust debuginfo for unsized structs with embedded slice types is lacking, and it makes it difficult for debuggers to correctly print types like `Rc<str>` (eg rust-lang#114195). Specifically, these three structs would have essentially the same debug info (modulo some names): ```rust struct Foo { a: u32, s: str } // unsized struct Bar { a: u32, s: [u8] } // unsized struct Baz { a: u32, s: u8 } ``` This changes how the compiler generates debuginfo in this case, and I used existing compilers (gcc, clang) handling of C flexible member arrays as a reference.
Rollup of 11 pull requests Successful merges: - #148788 (Unconstrained parameter fix) - #153238 (debuginfo: slices are DW_TAG_array_type's) - #155521 (Add lint againts invalid runtime symbol definitions) - #156319 (Require EIIs to be defined when we compile a rust dylib) - #156452 (Implement pinned drop sugar) - #156600 (Make const param default test reproduce original ICE) - #156493 (actually run the temp_dir doctest) - #156556 (Require UTF-8 in `Utf8Pattern::StringPattern`) - #156565 (delegation: emit error when self type is not specified and accessed) - #156586 (Use DropCtxt::new_block and new_block_with_statements systematically.) - #156587 (Correctly handle associated items in rustdoc macro expansion)
debuginfo: slices are DW_TAG_array_type's Rust debuginfo for unsized structs with embedded slice types is lacking, and it makes it difficult for debuggers to correctly print types like `Rc<str>` (eg rust-lang#114195). Specifically, these three structs would have essentially the same debug info (modulo some names): ```rust struct Foo { a: u32, s: str } // unsized struct Bar { a: u32, s: [u8] } // unsized struct Baz { a: u32, s: u8 } ``` This changes how the compiler generates debuginfo in this case, and I used existing compilers (gcc, clang) handling of C flexible member arrays as a reference.
…uwer Rollup of 12 pull requests Successful merges: - #153238 (debuginfo: slices are DW_TAG_array_type's) - #156319 (Require EIIs to be defined when we compile a rust dylib) - #156452 (Implement pinned drop sugar) - #156554 (Allow user-provided `llvm_args` to override target spec arguments) - #156571 (Disable `main_needs_argc_argv` for Wasm) - #156600 (Make const param default test reproduce original ICE) - #156493 (actually run the temp_dir doctest) - #156556 (Require UTF-8 in `Utf8Pattern::StringPattern`) - #156565 (delegation: emit error when self type is not specified and accessed) - #156586 (Use DropCtxt::new_block and new_block_with_statements systematically.) - #156587 (Correctly handle associated items in rustdoc macro expansion) - #156604 (coverage: Reduce and clarify the context-mismatch test case)
|
This pull request was unapproved. This PR was contained in a rollup (#156613), which was unapproved. |
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Is there a way to run the tests that failed in the rollup PR (auto - aarch64-msvc-1, try - x86_64-mingw-1, try - x86_64-msvc-1) on this PR? I think I fixed the issue, but I'm not able to check msvc compile targets on my machine. |
|
@bors try jobs=aarch64-msvc-1,x86_64-mingw-1,x86_64-msvc-1 |
This comment has been minimized.
This comment has been minimized.
debuginfo: slices are DW_TAG_array_type's try-job: aarch64-msvc-1 try-job: x86_64-mingw-1 try-job: x86_64-msvc-1
This comment has been minimized.
This comment has been minimized.
|
@bors try jobs=aarch64-msvc-1,x86_64-mingw-1,x86_64-msvc-1 |
|
@shua: 🔑 Insufficient privileges: not in try users |
|
@bors try jobs=aarch64-msvc-1,x86_64-mingw-1,x86_64-msvc-1 |
|
⌛ Trying commit d2b5baf with merge 2468142… (The previously running try build was automatically cancelled.) To cancel the try build, run the command Workflow: https://github.com/rust-lang/rust/actions/runs/25959675021 |
debuginfo: slices are DW_TAG_array_type's try-job: aarch64-msvc-1 try-job: x86_64-mingw-1 try-job: x86_64-msvc-1
View all comments
Rust debuginfo for unsized structs with embedded slice types is lacking, and it makes it difficult for debuggers to correctly print types like
Rc<str>(eg #114195). Specifically, these three structs would have essentially the same debug info (modulo some names):This changes how the compiler generates debuginfo in this case, and I used existing compilers (gcc, clang) handling of C flexible member arrays as a reference.