public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] New field la_varobj_ops in struct language_defn
Date: Fri, 25 Oct 2013 03:34:00 -0000	[thread overview]
Message-ID: <20131025033415.GB4769@adacore.com> (raw)
In-Reply-To: <1382057576-19148-1-git-send-email-yao@codesourcery.com>

> 2013-10-18  Yao Qi  <yao@codesourcery.com>
> 
> 	* language.h (struct lang_varobj_ops): Declare.
> 	(struct language_defn) <la_varobj_ops>: 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

  parent reply	other threads:[~2013-10-25  3:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-18  0:54 Yao Qi
2013-10-18  0:54 ` [PATCH 2/2] Remove varobj_language_string, languages and varobj_languages Yao Qi
2013-10-25  4:15   ` Joel Brobecker
2013-10-25 13:38     ` Yao Qi
2013-10-26  4:09       ` Joel Brobecker
2013-10-28 12:50     ` [PATCH 1/3] Constify 'la_name' in struct language_defn Yao Qi
2013-10-28 12:50       ` [PATCH 3/3] Remove varobj_language_string, languages and varobj_languages Yao Qi
2013-10-28 18:52         ` Tom Tromey
2013-10-29  8:33           ` Yao Qi
2013-10-29 16:49             ` Eli Zaretskii
2013-10-31  3:10               ` Yao Qi
2013-10-31 17:31                 ` Eli Zaretskii
2013-11-07  7:23               ` Yao Qi
2013-10-28 12:50       ` [PATCH 2/3] New field 'la_natural_name' in struct language_defn Yao Qi
2013-10-28 18:34         ` Tom Tromey
2013-10-29  8:41         ` Yao Qi
2013-11-07  7:18           ` Yao Qi
2013-10-28 15:02       ` [PATCH 1/3] Constify 'la_name' " Tom Tromey
2013-10-25  3:34 ` Joel Brobecker [this message]
2013-10-25 13:16   ` [PATCH 1/2] New field la_varobj_ops " Yao Qi
2013-10-27 12:04   ` Rename field 'lang' to 'lang_ops' ([PATCH 1/2] New field la_varobj_ops in struct language_defn) Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131025033415.GB4769@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).