public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Andrew Burgess <andrew.burgess@embecosm.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: Have allocate_target_description return a unique_ptr
Date: Wed, 7 Oct 2020 12:41:37 +0100	[thread overview]
Message-ID: <3de137cb-13c6-cd7b-23a0-52d7af358425@palves.net> (raw)
In-Reply-To: <20201005194728.699823-1-andrew.burgess@embecosm.com>

On 10/5/20 8:47 PM, Andrew Burgess wrote:
> --- a/gdb/features/rs6000/powerpc-601.c
> +++ b/gdb/features/rs6000/powerpc-601.c
> @@ -9,7 +9,7 @@ struct target_desc *tdesc_powerpc_601;
>  static void
>  initialize_tdesc_powerpc_601 (void)
>  {
> -  struct target_desc *result = allocate_target_description ();
> +  struct target_desc *result = allocate_target_description ().release ();
>    struct tdesc_feature *feature;
>  

Curious that you didn't tweak target-descriptions.c to output the more
pedantically correct:

  target_desc_up result = allocate_target_description ();

  ...

  feature = tdesc_create_feature (result.get (), "org.gnu.gdb.power.core");

  ...

  tdesc_powerpc_601 = result.release ();


Anyhow, I like this change too, with or without the change above.

Pedro Alves

  parent reply	other threads:[~2020-10-07 11:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-05 19:47 Andrew Burgess
2020-10-05 19:52 ` Simon Marchi
2020-10-07 11:41 ` Pedro Alves [this message]
2020-10-08  9:28   ` Andrew Burgess
2020-10-08 15:17     ` [PATCH] gdb: Delay releasing target_desc_up in more cases Andrew Burgess
2020-10-08 16:54       ` Shahab Vahedi
2020-10-09 10:47         ` Andrew Burgess

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=3de137cb-13c6-cd7b-23a0-52d7af358425@palves.net \
    --to=pedro@palves.net \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    /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).