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

rust-lldb unable to pretty-print PathBuf or OsString #48462

Closed
tmccombs opened this issue Feb 23, 2018 · 2 comments · Fixed by #120557
Closed

rust-lldb unable to pretty-print PathBuf or OsString #48462

tmccombs opened this issue Feb 23, 2018 · 2 comments · Fixed by #120557
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-enhancement Category: An issue proposing an enhancement or a PR with one. P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@tmccombs
Copy link
Contributor

If path is a PathBuf, printing it from lldb does not give a string representation as I would expect.

(lldb) frame variable path
Traceback (most recent call last):
  File "/home/thayne/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/etc/lldb_rust_formatters.py", line 99, in print_val
    is_tuple_like = False)
  File "/home/thayne/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/etc/lldb_rust_formatters.py", line 220, in print_struct_val
    body = separator.join([render_child(idx) for idx in range(field_start_index, len(fields))])
  File "/home/thayne/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/etc/lldb_rust_formatters.py", line 213, in render_child
    return this + print_val(field_val.get_wrapped_value(), internal_dict)
TypeError: cannot concatenate 'str' and 'NoneType' objects
(std::path::PathBuf) path = {
  inner = None
}

If I explicitly refer to path.inner it shows "None" for the inner OsString:

(lldb) frame variable path.inner
(std::ffi::os_str::OsString) path.inner = None

If I use path.inner.inner I finally get a vec representation.

@pietroalbini pietroalbini added A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 27, 2018
@nbigaouette
Copy link
Contributor

I've added details in #63266.

@wesleywiser wesleywiser added the P-medium Medium priority label Mar 20, 2023
@wesleywiser
Copy link
Member

Visited during wg-debugging triage. We were not able to conclusively repro but we're confident this is probably still an issue. Triaging as P-medium for now.

n8henrie added a commit to n8henrie/rust that referenced this issue Feb 1, 2024
n8henrie added a commit to n8henrie/rust that referenced this issue Feb 1, 2024
n8henrie added a commit to n8henrie/rust that referenced this issue Mar 17, 2024
n8henrie added a commit to n8henrie/rust that referenced this issue Mar 17, 2024
n8henrie added a commit to n8henrie/rust that referenced this issue Mar 18, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 24, 2024
…lacrum

Add rust-lldb pretty printing for Path and PathBuf

Fixes rust-lang#120553
Fixes rust-lang#48462
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 25, 2024
…lacrum

Add rust-lldb pretty printing for Path and PathBuf

Fixes rust-lang#120553
Fixes rust-lang#48462
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 25, 2024
…crum

Add rust-lldb pretty printing for Path and PathBuf

Fixes rust-lang#120553
Fixes rust-lang#48462
n8henrie added a commit to n8henrie/rust that referenced this issue Mar 26, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 28, 2024
…crum

Add rust-lldb pretty printing for Path and PathBuf

Fixes rust-lang#120553
Fixes rust-lang#48462
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 29, 2024
…crum

Add rust-lldb pretty printing for Path and PathBuf

Fixes rust-lang#120553
Fixes rust-lang#48462
n8henrie added a commit to n8henrie/rust that referenced this issue Mar 29, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 30, 2024
…crum

Add rust-lldb pretty printing for Path and PathBuf

Fixes rust-lang#120553
Fixes rust-lang#48462
@bors bors closed this as completed in 41e97a0 Mar 30, 2024
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-enhancement Category: An issue proposing an enhancement or a PR with one. P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants