Re: [PATCH 2/2] Remove varobj_language_string, languages and varobj_languages

Yao Qi
2013-10-25T13:38:42Z

On 10/25/2013 12:15 PM, Joel Brobecker wrote:
> I think this can do for now because it is good enough, but I would
> definitely prefer we avoid this type transformation. Instead,
> I'd rather we added a new field in struct language_defn that
> provides the "natural" name.
>

I am OK to add a new field "la_varobj_name" in struct language_defn, but
seems information is duplicated a little, we have both "c++" and "C++"
in one language_defn.

>> >2013-10-18 Yao Qi<yao@codesourcery.com>
>> >
>> > * mi/mi-cmd-var.c: Include "language.h" and <ctype.h>.
>> > (mi_cmd_var_info_expression): Get language name from
>> > language_defn.
>> > * varobj.c (varobj_language_string): Remove.
>> > (variable_language): Remove declaration.
>> > (languages): Remove.
>> > (varobj_get_language): Change the type of return value.
>> > (variable_language): Remove.
>> > * varobj.h (enum varobj_languages): Remove.
>> > (varobj_language_string): Remove declaration.
>> > (varobj_get_language): Update declaration.
> Personally, I would do the language_defn update first, and then get
> rid of the xstrdup/toupper/xfree dance. But I'm open to others'
> opinion.

One drawback of xstrdup/toupper/xfree dance is that we loose the freedom
to show language name in varobj. I'll post patches in the way you
suggested if no one else has other comments here.

--
Yao (é½å°§)