Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 5/5] gdb: make find_memory_region_ftype a function_view
Date: Sat, 14 Mar 2026 14:48:40 -0400	[thread overview]
Message-ID: <986c042d-86b5-4e9e-a7b2-b95ee9745743@polymtl.ca> (raw)
In-Reply-To: <87a4wbr2hx.fsf@tromey.com>



On 2026-03-13 14:46, Tom Tromey wrote:
>>>>>> "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>

Well, it does feel wrong to have the typedef in gdbarch.h, because it is
not more a "gdbarch.h" thing than it is a "target.h"  thing.  Both
headers are equal users of the typedef.  So I think it makes sense for
it to be in a third header that they both include.

I will send a new patch where the typedef is in a new file called
`find-memory-region.h`.

Simon

  reply	other threads:[~2026-03-14 18:49 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
2026-03-14 18:48     ` Simon Marchi [this message]
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=986c042d-86b5-4e9e-a7b2-b95ee9745743@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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