This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] varobj: call CHECK_TYPEDEF
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: David Carlton <carlton at math dot stanford dot edu>,Andrew Cagney <ac131313 at redhat dot com>,"gdb-patches at sources dot redhat dot com" <gdb-patches at sources dot redhat dot com>
- Date: Wed, 11 Jun 2003 21:28:10 -0400
- Subject: Re: [RFA] varobj: call CHECK_TYPEDEF
- References: <1051215397.1538.43.camel@lindt.uglyboxes.com> <3EA84A9B.5020308@redhat.com> <1051221433.1534.72.camel@lindt.uglyboxes.com> <3EA8629B.50603@redhat.com> <1055362509.1571.63.camel@lindt.uglyboxes.com> <ro1d6hk5g4q.fsf@jackfruit.Stanford.EDU> <1055378162.1571.98.camel@lindt.uglyboxes.com>
On Wed, Jun 11, 2003 at 05:36:02PM -0700, Keith Seitz wrote:
> On Wed, 2003-06-11 at 16:49, David Carlton wrote:
> > I've just gone and looked over the thread and at Keith's patch; I
> > think the idea is sound, but the implementation isn't. The comments
> > at the top of get_type say that it's supposed to skip past typedefs,
> > so calling CHECK_TYPEDEF certainly seems legitimate. But
> > CHECK_TYPEDEF calls check_typedef, which already goes through chains
> > of typedefs, so you can get rid of the loop in get_type.
>
> Yup, I think you are correct. I'm sure that I was just being laz^Whasty.
> :-)
David's analysis sounds right to me. I'll look over the actual code
tomorrow, really I will...
> I'll note that there is still one failure in the testsuite.
> gdb.mi/mi-var-display.exp: create local variable weird (aka insight's
> c_variable 6.22) fails because the output type is now considered "struct
> _struct_decl" instead of it's typedef name "weird".
>
> I believe it is a bug below varobj, though. In varobj_create,
> gdb_evaluate_expression is called. It returns the struct value for the
> expression. It returns a type that looks like:
>
> var->value->type->main_type->code = TYPE_CODE_PTR
> var->value->type->main_type->target_type->main_type->code =
> TYPE_CODE_STRUCT, tag_name="_struct_decl"
>
> I think that this is wrong, and it should be "TYPE_CODE_TYPEDEF" and
> "weird_struct"...
>
> Or am I yet again being laz^Whasty? :-)
> Keith
I am 99.99% certain that this test is a compiler problem, not a GDB
problem, and that I fixed it in GCC a few months ago. My memory's
going though :P
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer