From: Tom Tromey <tom@tromey.com>
To: simon.marchi@polymtl.ca
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 5/5] gdb: make find_memory_region_ftype a function_view
Date: Fri, 13 Mar 2026 12:46:50 -0600 [thread overview]
Message-ID: <87a4wbr2hx.fsf@tromey.com> (raw)
In-Reply-To: <20260310173104.676640-5-simon.marchi@polymtl.ca> (simon marchi's message of "Tue, 10 Mar 2026 13:30:36 -0400")
>>>>> "Simon" == simon marchi <simon.marchi@polymtl.ca> writes:
Simon> From: Simon Marchi <simon.marchi@polymtl.ca>
Simon> Make it a function_view and remove the `void *` parameter. Convert the
Simon> callers (in gcore.c) to use lambda functions that capture `obfd`.
Simon> One thing is that I am not sure how to implement
Simon> target_debug_print_find_memory_region_ftype now... right now I made it
Simon> return a constant "<function_view>" string.
I think this is fine. Some of these debug printers are already not
really that useful.
Simon> To make target.h see find_memory_region_ftype, I added an include of
Simon> gdbarch.h in target.h, I'm not sure if this is undesirable, possibly
Simon> causing some circular include problem in the future.
Simon> find_memory_region_ftype was previously in defs.h. Leaving it there
Simon> would require including gdbsupport/function-view.h inside defs.h, which
Simon> I would prefer not to do. An alternative would be to place
Simon> find_memory_region_ftype in a smaller (perhaps a new) header file, but I
Simon> don't really know which one.
It's tempting to try to fix it now before it is a problem.
Though I somewhat suspect that what you have already is fine.
I do think having a new small header just for this type would be
completely fine and I think it's a reasonable long-term strategy for
handling this kind of "pro forma" typedef. As in, I'd encourage this in
other cases where breaking circular dependencies is needed.
Anyway I also think this is ok.
Approved-By: Tom Tromey <tom@tromey.com>
Tom
next prev parent reply other threads:[~2026-03-13 18:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 17:30 [PATCH 1/5] gdb/linux-tdep: check return value of linux_find_memory_region_ftype callback simon.marchi
2026-03-10 17:30 ` [PATCH 2/5] gdb/gcore: check return values of some find_memory_region_ftype calls simon.marchi
2026-03-13 18:21 ` Tom Tromey
2026-03-10 17:30 ` [PATCH 3/5] gdb/linux-tdep: make linux_find_memory_region_ftype a function_view simon.marchi
2026-03-13 18:25 ` Tom Tromey
2026-03-10 17:30 ` [PATCH 4/5] gdb/linux-tdep: remove linux_collect_thread_registers_ftype typedef simon.marchi
2026-03-13 18:25 ` Tom Tromey
2026-03-14 18:43 ` Simon Marchi
2026-03-10 17:30 ` [PATCH 5/5] gdb: make find_memory_region_ftype a function_view simon.marchi
2026-03-13 18:46 ` Tom Tromey [this message]
2026-03-14 18:48 ` Simon Marchi
2026-03-14 19:06 ` [PATCH v2] " simon.marchi
2026-03-19 13:57 ` Tom Tromey
2026-03-19 14:08 ` Simon Marchi
2026-03-13 18:21 ` [PATCH 1/5] gdb/linux-tdep: check return value of linux_find_memory_region_ftype callback Tom Tromey
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=87a4wbr2hx.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--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