Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Guinevere Larsen <guinevere@redhat.com>
To: Simon Marchi <simon.marchi@efficios.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/record-full: make record_full_arch_list_add take an rvalue ref
Date: Tue, 7 Jul 2026 15:54:13 -0300	[thread overview]
Message-ID: <0f8bd92f-7940-4faa-b5a8-7bd67f0a94f5@redhat.com> (raw)
In-Reply-To: <20260706164012.507674-1-simon.marchi@efficios.com>

On 7/6/26 1:40 PM, Simon Marchi wrote:
> record_full_arch_list_add moves its `rec` argument, so it should take an
> rvalue ref to reflect that.  Otherwise the fact that the object is moved
> from can be a "surprise" to the callers.
>
> Change-Id: Ibeb56b1523ad8aee077d3bc3cad1f00d6b47ea2f
> ---

Yeah, this makes sense, and feels pretty straightforward

Approved-By: Guinevere Larsen <guinevere@redhat.com>

>   gdb/record-full.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/gdb/record-full.c b/gdb/record-full.c
> index 1392510a175c..aa451c05a5d9 100644
> --- a/gdb/record-full.c
> +++ b/gdb/record-full.c
> @@ -735,7 +735,7 @@ record_full_log_release_first (void)
>   /* Add a struct record_full_entry to record_full_arch_list.  */
>   
>   static void
> -record_full_arch_list_add (record_full_entry &rec)
> +record_full_arch_list_add (record_full_entry &&rec)
>   {
>     record_full_incomplete_instruction.effects.push_back (std::move (rec));
>   }
> @@ -758,7 +758,7 @@ record_full_arch_list_add_reg (struct regcache *regcache, int regnum)
>     if (regnum == gdbarch_pc_regnum (regcache->arch ()))
>         record_full_incomplete_instruction.pc = std::move (rec.reg ());
>     else
> -      record_full_arch_list_add (rec);
> +      record_full_arch_list_add (std::move (rec));
>   
>     return 0;
>   }
> @@ -784,7 +784,7 @@ record_full_arch_list_add_mem (CORE_ADDR addr, int len)
>   			  rec.get_loc (), len))
>       return -1;
>   
> -  record_full_arch_list_add (rec);
> +  record_full_arch_list_add (std::move (rec));
>   
>     return 0;
>   }
> @@ -2399,7 +2399,7 @@ record_full_entry::from_bfd (bfd *cbfd, asection *osec, int *bfd_offset)
>   			    bfd_get_filename (cbfd)));
>         break;
>       }
> -  record_full_arch_list_add (rec);
> +  record_full_arch_list_add (std::move (rec));
>   }
>   
>   void
>
> base-commit: abcf25501f986df152581faeff08419c198a7ec3


-- 
Cheers,
Guinevere Larsen
it/its
she/her (deprecated)


  reply	other threads:[~2026-07-07 18:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 16:40 Simon Marchi
2026-07-07 18:54 ` Guinevere Larsen [this message]
2026-07-07 18:56   ` 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=0f8bd92f-7940-4faa-b5a8-7bd67f0a94f5@redhat.com \
    --to=guinevere@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.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