This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Language of registers
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sourceware dot org
- Date: Fri, 1 Dec 2006 09:32:19 -0500
- Subject: Re: Language of registers
- References: <200611251421.43173.vladimir@codesourcery.com> <20061127140344.GA32528@nevyn.them.org> <200611282004.11537.vladimir@codesourcery.com> <20061128172327.GG21834@nevyn.them.org> <ekhtto$rgd$1@sea.gmane.org>
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