This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug mi/10586] Anonymous unions/structs not handled correctly under MI
- From: "nickrob at snap dot net dot nz" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: 11 Oct 2009 00:36:07 -0000
- Subject: [Bug mi/10586] Anonymous unions/structs not handled correctly under MI
- References: <20090901200751.10586.elethiomel@gmail.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From nickrob at snap dot net dot nz 2009-10-11 00:36 -------
Subject: Anonymous unions/structs not handled correctly under MI
> The above session is via Eclipse/CDT, not manually controlled by me. It's the
> output from the CDT set to verbose. If CDT is in fact issuing senseless
> commands, I'll definitely file a new bug with them .
OK, that's interesting. I would presume that there is a purpose. In that case:
> > (gdb)
> > 522 ptype test::<anonymous struct>
> > &"ptype test::<anonymous struct>\n"
> > &"A syntax error in expression, near `<anonymous struct>'.\n"
> > 522^error,msg="A syntax error in expression, near `<anonymous struct>'."
I think this is a bug with CDT as it shouldn't be using ptype and, if it does,
it needs to ensure it has a valid expression or data type as an argument.
> > (gdb)
> > 534-data-evaluate-expression ((bar).0).a
> > 534^error,msg="A syntax error in expression, near `.0).a'."
This would be a bug in GDB (if my patch is installed) ...
> The version of Eclipse/CDT I use is Galileo-SR1. It's the version you'll get if
> you choose "Eclipse IDE for C/C++ Developers" from http://www.eclipse.org/downloads/
>
> The patch definitely works with the simple tests I posted. When I get into work
> tomorrow I'll throw my main code at it (It uses anonymous structs/unions heavily).
... however, if behaviour is improved then, although not perfect, it's probably
worth installing this change.
> As a matter of style, can I suggest names such as anon_union_1 or anon_struct_5
> rather than just numbers?
I suggest proposing such changes on the gdb mailing list where it will receive
wider attention.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=10586
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.