This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Language of registers
Daniel Jacobowitz wrote:
> On Tue, Nov 28, 2006 at 08:04:11PM +0300, Vladimir Prus wrote:
>> First of all, varobjs don't know anything about Ada. Further, unlike CLI,
>> varobj don't have any language-specific formatting -- it's just tree of
>> values.
>
> Sure there is. There isn't for structs or arrays, but I presume it
> still calls the language specific routines for formatting e.g.
> integers. And types.
>
> (gdb) set language ada
> (gdb) interpreter-exec mi "-var-create - * $xmm0"
> ^done,name="var1",numchild="7",type="builtin_type_vec128i"
> (gdb)
> (gdb) interpreter-exec mi "-var-list-children var1"
>
^done,numchild="7",children=[child={name="var1.v4_float",exp="v4_float",numchild="4",type="array
> (...) of
> float"},
What I said ("varobjs don't know anything about Ada") is still true,
though ;-)
There are two completely independent languages. One language is that used to
values and types -- the one changed by "set language". The type output
above comes from "type_print", that just calls LA_PRINT_TYPE, which is just
wrapper over current_language->la_print_type.
On the other hand, varobj->root->lang is internal to varobj.c -- it selects
which of language specific function inside varobj.c itself are called
later.
>> The change does not seem very complex, but the changes to testcases will
>> be huge, so I'd like to check. Does everybody agree with removing
>> "public" pseudo-field from structures that have only public fields?
>
> We can't tell reliably if something was declared as "struct" or "class"
> in the source, but I think unions default to public, don't they?
The *default* to public, but you can have private members in a union.
- Volodya