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-gdb starts with error on nightly #35724

Closed
ereichert opened this issue Aug 16, 2016 · 8 comments
Closed

rust-gdb starts with error on nightly #35724

ereichert opened this issue Aug 16, 2016 · 8 comments
Assignees
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)

Comments

@ereichert
Copy link

This may be related to

#35585
#35155

Tried to run rust-gdb for the first time in a while so I'm not sure when this started.

nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.12.0-nightly (197be89 2016-08-15)

rust-gdb --args target/debug/tlx ~/Downloads/moviesample/trailer.mp4
GNU gdb (GDB) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from target/debug/tlx...done.
Traceback (most recent call last):
File "/root/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/etc/gdb_load_rust_pretty_printers.py", line 11, in
import gdb_rust_pretty_printing
File "/root/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/etc/gdb_rust_pretty_printing.py", line 19, in
if sys.version_info.major >= 3:
AttributeError: 'tuple' object has no attribute 'major'
(gdb)

Works on stable however:

stable-x86_64-unknown-linux-gnu unchanged - rustc 1.10.0 (cfcb716 2016-07-03)

rust-gdb --args target/debug/tlx ~/Downloads/moviesample/trailer.mp4
GNU gdb (GDB) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from target/debug/tlx...done.
(gdb)

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

Can you try opening /root/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/etc/gdb_rust_pretty_printing.py and changing the if sys.version_info.major >= 3: to if sys.version_info[0] >= 3:? That should be compatible with more versions of Python.

@ereichert
Copy link
Author

Is that request still applicable if I'm using rustup instead of multirust?

@michaelwoerister
Copy link
Member

Yes, I just copied the path from your error report above, so that should be the correct one.

@ereichert
Copy link
Author

Ignore that last comment. I see that rustup uses .multirust.

Same result however.

rust-gdb --args target/debug/tlx ~/Downloads/moviesample/trailer.mp4
GNU gdb (GDB) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from target/debug/tlx...done.
Traceback (most recent call last):
File "/root/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/etc/gdb_load_rust_pretty_printers.py", line 11, in
import gdb_rust_pretty_printing
File "/root/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/etc/gdb_rust_pretty_printing.py", line 19, in
if sys.version_info.major[0] >= 3:
AttributeError: 'tuple' object has no attribute 'major'
(gdb)

@ereichert
Copy link
Author

Sorry. I see the problem.

@ereichert
Copy link
Author

That did the job.

rust-gdb --args target/debug/tlx ~/Downloads/moviesample/trailer.mp4
GNU gdb (GDB) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from target/debug/tlx...done.
(gdb)

@michaelwoerister
Copy link
Member

Excellent :) Thanks for your help! I'll make a PR with the fix.

@ereichert
Copy link
Author

Thanks

bors added a commit that referenced this issue Aug 24, 2016
…, r=brson

Make version check in gdb_rust_pretty_printing.py more compatible.

Some versions of Python don't support the `major` field on the object returned by `sys.version_info`.

Fixes #35724

r? @brson
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.)
Projects
None yet
Development

No branches or pull requests

2 participants