Skip to content
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

Add gdb pretty printers for slices types (&[T] and &mut [T]). #85219

Closed
EFanZh opened this issue May 12, 2021 · 3 comments · Fixed by #85363
Closed

Add gdb pretty printers for slices types (&[T] and &mut [T]). #85219

EFanZh opened this issue May 12, 2021 · 3 comments · Fixed by #85363
Labels
A-slice Area: [T] C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue.

Comments

@EFanZh
Copy link
Contributor

EFanZh commented May 12, 2021

Currently, support for pretty-printing slice types is missing for rust-gdb.

@DaviRain-Su
Copy link

Can you describe in more detail?

@EFanZh
Copy link
Contributor Author

EFanZh commented May 12, 2021

rust-gdb provides pretty-printing function for some Rust types, such as &str, Vec, HashMap, etc. This allows gdb to display values of some types in a more readable way. I think it is implemented in the following files:

Currently, slices can only be displayed as a pointer and a length value in the debugger. I hope rust-gdb can support displaying slices.

I also noticed that rust-lldb already supports pretty-printing const slices (&[T]), but not mutable slices (&mut [T]). Maybe rust-lldb can also add pretty-printing support fur mutable slices.

JohnTitor added a commit to JohnTitor/rust that referenced this issue May 26, 2021
…ark-Simulacrum

Support pretty printing slices using GDB

Support pretty printing `&[T]`, `&mut [T]` and `&mut str` types using GDB.

Support pretty printing `&mut [T]` and `&mut str` types using LLDB.

Fixes rust-lang#85219.
@inquisitivecrystal
Copy link
Contributor

@rustbot label A-slice C-enhancement T-dev-tools

@rustbot rustbot added A-slice Area: [T] C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. labels Jun 4, 2021
@bors bors closed this as completed in 0deb536 Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-slice Area: [T] C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants