Accessing tuple-struct members fails in GDB
Open
Nobody has claimed this yet.
bug
- Dominant language
- C++
- Stars
- 2.9k
- Forks
- 231
- Avg merge
- 19h 55m
- Merged PRs (30d)
- 67
Description
I tried this code:
Temporary breakpoint 1, main () at test.rs:26
26 let a = Foo::<i32>::new::<f32>(123, 456f32);
(gdb) n
27 let b = Foo::new::<f32>(123, 456f32);
(gdb) p a
$1 = {0: 123}
(gdb) p a.0
Anonymous field access is only allowed on tuples, tuple structs, and tuple-like enum variants
I expected to see this happen: gdb prints 123
Instead, this happened: "Anonymous field access is only allowed on tuples, tuple structs, and tuple-like enum variants"
Meta
- What version of Rust GCC were you using, git sha if possible. 257bf55827474e500d83d96b7a8f8ebacbd11e7d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure using the Rust snippet in test.rs and GDB, starting with the tuple-struct expression at test.rs:26 and the p a.0 command. Trace how gccrs exposes tuple-struct members to GDB; done means GDB prints 123 for a.0 instead of rejecting anonymous field access.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100