public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@polymtl.ca>,
	 Simon Marchi <simon.marchi@efficios.com>
Subject: Re: [PATCH 1/3] gdb: add owner-related methods to struct type
Date: Fri, 22 Jan 2021 08:31:37 -0700	[thread overview]
Message-ID: <87ft2touna.fsf@tromey.com> (raw)
In-Reply-To: <20210121032410.97525-1-simon.marchi@polymtl.ca> (Simon Marchi via Gdb-patches's message of "Wed, 20 Jan 2021 22:24:08 -0500")

>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> From: Simon Marchi <simon.marchi@efficios.com>
Simon> Add the following methods to struct type:

Simon>  * is_objfile_owned
Simon>  * set_owner (objfile and gdbarch overloads)
Simon>  * objfile and arch getters

Simon> Rename the fields in main_type to ensure no other code accesses them
Simon> directly.  As usual, we can't make them actually private, but giving
Simon> them the `m_` prefix will help making sure they are not accessed when
Simon> not supposed to, by convention.

Simon> Remove the TYPE_OWNER macro to ensure no code uses the type_owner struct
Simon> directly.

Looks good, with one small nit.

Simon> +  gdbarch *arch () const
Simon> +  {
Simon> +    if (this->is_objfile_owned ())
Simon> +      return nullptr;
Simon> +
Simon> +  /* Return the gdbarch owner of this type.
Simon> +
Simon> +     Return nullptr if this type is not gdbarch-owned.  */
Simon> +    return this->main_type->m_owner.gdbarch;
Simon> +  }

This comment got misplaced into the middle of the method.

Tom

  parent reply	other threads:[~2021-01-22 15:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21  3:24 Simon Marchi
2021-01-21  3:24 ` [PATCH 2/3] gdb: remove TYPE_OBJFILE_OWNED macro Simon Marchi
2021-01-22 15:33   ` Tom Tromey
2021-01-21  3:24 ` [PATCH 3/3] gdb: remove TYPE_OBJFILE macro Simon Marchi
2021-01-22 15:34   ` Tom Tromey
2021-01-22 17:25     ` Simon Marchi
2021-01-22 15:31 ` Tom Tromey [this message]
2021-01-22 17:21   ` [PATCH 1/3] gdb: add owner-related methods to struct type Simon Marchi
2021-01-22 19:42     ` Simon Marchi

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=87ft2touna.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.com \
    --cc=simon.marchi@polymtl.ca \
    /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).