Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

New gdb with Rust support does not honor rust-gdb's pretty printers #35155

Closed
DemiMarie opened this issue Aug 1, 2016 · 3 comments
Closed

New gdb with Rust support does not honor rust-gdb's pretty printers #35155

DemiMarie opened this issue Aug 1, 2016 · 3 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)

Comments

@DemiMarie
Copy link
Contributor

gdb git HEAD, when invoked via rust-gdb, does not honor the Rust pretty-printers. This results in bad printing of types like Vec.

@michaelwoerister michaelwoerister added the A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) label Aug 1, 2016
@michaelwoerister
Copy link
Member

cc @tromey

@tromey
Copy link
Contributor

tromey commented Aug 2, 2016

It's most useful if you can report the version of rustc that you are using. I was able to reproduce the problem with stable. I'll look into it.

@tromey
Copy link
Contributor

tromey commented Aug 2, 2016

The older gdb says the type of a vec variable is:

(gdb) whatis x
type = struct Vec<i32>

However git gdb says:

(gdb) whatis x
type = collections::vec::Vec<i32>

The rust pretty-printers assume that the type tag holds the unqualified name (see GdbType.get_unqualified_type_name), but in git gdb, this is not the case:

(gdb) python print (val.type.tag)
collections::vec::Vec<i32>

Perhaps the Rust gdb scripts could be updated to recognize this name, though I'm not 100% certain this will work in all cases.

bors added a commit that referenced this issue Aug 31, 2016
gdb: Fix pretty-printing special-cased Rust types

gdb trunk now reports fully qualified type names, just like lldb. Move lldb code for extracting unqualified names to shared file.

For current releases of gdb, `extract_type_name` should just be a no-op.

Fixes #35155
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)
Projects
None yet
Development

No branches or pull requests

3 participants