This is the mail archive of the
mailing list for the GDB project.
Re: [RFA] mi/10586
- From: Tom Tromey <tromey at redhat dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: "gdb-patches\ at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Tue, 13 Dec 2011 12:39:52 -0700
- Subject: Re: [RFA] mi/10586
- References: <4EBD93D9.firstname.lastname@example.org> <email@example.com> <4EC157F6.firstname.lastname@example.org> <email@example.com> <4EC16BD8.firstname.lastname@example.org> <email@example.com> <4EC29CF7.firstname.lastname@example.org> <4ED95103.email@example.com>
>>>>> "Keith" == Keith Seitz <firstname.lastname@example.org> writes:
Keith> +/* The names of varobjs representing anonymous structs or unions.
Keith> + Note that is_name_anonymous_type makes assumptions about these two
Keith> + constants. */
I didn't see 'is_name_anonymous_type' anywhere in the tree or in the patch.
I guess it needs an update.
Keith> +static int
Keith> +is_path_expr_parent (struct varobj *var)
Keith> + type = get_value_type (var);
Keith> + return strncmp (child->name, ANONYMOUS_STRUCT_NAME, 11) == 0;
I think this is wrong since the macros have _() in their expansion.
I think you have to use strlen.
Keith> + field_name = TYPE_FIELD_NAME (type, index);
Keith> + if (*field_name == '\0')
Can field_name == NULL?
It is not clear to me. There is some code in gdb that checks this, but
I don't know whether that is defensive programming or checking a
condition that is truly possible.
Otherwise this looks good to me.