From: Tom Tromey <tom@tromey.com>
To: Simon Marchi <simon.marchi@efficios.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] gdb: use gdb::unordered_{set,map} at a few places
Date: Fri, 14 Nov 2025 12:49:36 -0700 [thread overview]
Message-ID: <87a50ov1gv.fsf@tromey.com> (raw)
In-Reply-To: <20251113214507.359286-1-simon.marchi@efficios.com> (Simon Marchi's message of "Thu, 13 Nov 2025 16:43:56 -0500")
>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
Simon> New in v2:
Simon> - I forgot to actually build-test with all targets enabled, so I was
Simon> missing a change in solib-rocm.c.
Simon> Use the gdb:: set/map types instead of the std:: ones. I only changed
Simon> places in files I can build on my dev machine.
Simon> I needed to explicitly default the move constructor and assigment
Simon> operator in proc_mem_file. I think this is ok, as nothing takes the
Simon> address of a proc_mem_file, requiring it not to move.
Simon> I also needed to do it for refcnt_fd, in solib-rocm.c. It's a bit odd
Simon> to prevent moving / copying a refcnt_fd, as this struct doesn't directly
Simon> hold a resource, but I think I get why it was done.
The patch removes DISABLE_COPY_AND_ASSIGN from refcnt_fd, but that seems
like it shouldn't be needed -- the map should handle move-only types
fine, and I think proc_mem_file is already one such.
Simon> struct refcnt_fd
Simon> {
Simon> - DISABLE_COPY_AND_ASSIGN (refcnt_fd);
Simon> refcnt_fd (int fd, int refcnt) : fd (fd), refcnt (refcnt) {}
i.e. this change seems unnecessary.
Adding DISABLE_COPY_AND_ASSIGN to proc_mem_file isn't really need, since
it's handled by scoped_fd, though maybe it's worthwhile for clarity.
Tom
next prev parent reply other threads:[~2025-11-14 19:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-13 21:35 [PATCH] " Simon Marchi
2025-11-13 21:43 ` [PATCH v2] " Simon Marchi
2025-11-14 19:49 ` Tom Tromey [this message]
2025-11-14 20:00 ` Simon Marchi
2025-11-14 20:05 ` Tom Tromey
2025-11-14 20:32 ` Simon Marchi
2025-11-14 21:10 ` Tom Tromey
2025-11-14 21:15 ` Simon Marchi
2025-11-14 21:43 ` Tom Tromey
2025-11-14 22:20 ` Simon Marchi
2025-11-17 15:58 ` Tom Tromey
2025-11-17 16:31 ` Simon Marchi
2026-07-27 16:21 ` Daniel Fellows
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=87a50ov1gv.fsf@tromey.com \
--to=tom@tromey.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