This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Language of registers


On Tue, Nov 28, 2006 at 09:07:52PM +0300, Vladimir Prus wrote:
> 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.

I don't think that's accurate.  They're not independent.
var->root->lang is set from var->root->exp->language_defn, which is
captured from the global current language when the expression is
parsed.

Having -var-create do something magically different for registers is
strange and confusing.  Maybe, if the patch to automatically create
varobjs for registers goes in, that new command should always use
language_c?

> >> 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.

That's what I meant.  We can see "oh, this is a union" -> "its default
is public".  We don't know for sure if a source construct was "struct"
(public by default) or "class", though.  But it sounds like we can't
remove the public child now anyway.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]