From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8876 invoked by alias); 25 Oct 2013 03:34:21 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 8863 invoked by uid 89); 25 Oct 2013 03:34:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 25 Oct 2013 03:34:20 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 792381161D6; Thu, 24 Oct 2013 23:34:44 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id q18fo-eNRvzO; Thu, 24 Oct 2013 23:34:44 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 1D6131161A3; Thu, 24 Oct 2013 23:34:44 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 55AC3E10A4; Fri, 25 Oct 2013 07:34:15 +0400 (RET) Date: Fri, 25 Oct 2013 03:34:00 -0000 From: Joel Brobecker To: Yao Qi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 1/2] New field la_varobj_ops in struct language_defn Message-ID: <20131025033415.GB4769@adacore.com> References: <1382057576-19148-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1382057576-19148-1-git-send-email-yao@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-10/txt/msg00776.txt.bz2 > 2013-10-18 Yao Qi > > * language.h (struct lang_varobj_ops): Declare. > (struct language_defn) : New field. > * ada-lang.c: Include "varobj.h" > (defn ada_language_defn): Initialize field 'la_varobj_ops' with > ada_varobj_ops. > * c-lang.c: Include "varobj.h" > (c_language_defn): Initialize field 'la_varobj_ops' with > c_varobj_ops. > (cplus_language_defn): Initialize field 'la_varobj_ops' with > cplus_varobj_ops. > (asm_language_defn): Initialize field 'la_varobj_ops' with > default_varobj_ops. > (minimal_language_defn): Likewise. > * d-lang.c (d_language_defn): Likewise. > * f-lang.c (f_language_defn): Likewise. > * go-lang.c (go_language_defn): Likewise. > * m2-lang.c (m2_language_defn): Likewise. > * objc-lang.c (objc_language_defn): Likewise. > * opencl-lang.c (opencl_language_defn): Likewise. > * p-lang.c (pascal_language_defn): Likewise. > * language.c (unknown_language_defn): Likewise. > (auto_language_defn): Likewise. > (local_language_defn): Likewise. > * jv-lang.c (java_language_defn): Initialize field > 'la_varobj_ops' with java_varobj_ops. > * varobj.c (varobj_create): Update. > * varobj.h (default_varobj_ops): Define macro. The change looks mostly OK to me. My only real comment is that I'd rather we define default_varobj_ops without the '&' so that uses of that macro is similar to the case where the macro isn't used. OK with that change. Also, as a followup, I think it would be beneficial if we renamed field "lang" in the varobj_root into "lang_ops". I think it's more descriptive, especially since "lang" is used elsewhere with different meanings (and types). > --- a/gdb/varobj.h > +++ b/gdb/varobj.h > @@ -230,6 +230,7 @@ const struct lang_varobj_ops cplus_varobj_ops; > const struct lang_varobj_ops java_varobj_ops; > const struct lang_varobj_ops ada_varobj_ops; > > +#define default_varobj_ops &c_varobj_ops > /* API functions */ > > extern struct varobj *varobj_create (char *objname, > -- > 1.7.7.6 -- Joel