Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [PATCH] gdb/record-full: make record_full_arch_list_add take an rvalue ref
Date: Mon,  6 Jul 2026 12:40:09 -0400	[thread overview]
Message-ID: <20260706164012.507674-1-simon.marchi@efficios.com> (raw)

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
---
 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
-- 
2.55.0


             reply	other threads:[~2026-07-06 16:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 16:40 Simon Marchi [this message]
2026-07-07 18:54 ` Guinevere Larsen
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=20260706164012.507674-1-simon.marchi@efficios.com \
    --to=simon.marchi@efficios.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