public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: Simon Marchi <simark@simark.ca>
Cc: Tom Tromey <tromey@adacore.com>,  gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] Implement pid_to_exec_file for Windows in gdbserver
Date: Thu, 28 Apr 2022 13:50:25 -0600	[thread overview]
Message-ID: <87mtg5kmwu.fsf@tromey.com> (raw)
In-Reply-To: <52345d0e-12bf-bbd8-0ec6-fdfd6b5487ef@simark.ca> (Simon Marchi's message of "Wed, 27 Apr 2022 21:33:51 -0400")

Simon> It seems a bit strange to pass a pid to this method.  Doesn't a
Simon> windows_process_info object know its own pid?

It does, but only in gdbserver.  And, even there, the 'id' field isn't
really needed and can be removed -- it just replicates information
already stored elsewhere.

Simon> So maybe we can have a gdb_assert in
Simon> windows_nat_target::pid_to_exec_file to verify that (and the same
Simon> GDBserver-side)?

... so I think instead of doing this, I'd rather just drop the 'id'
field.

Simon> The day the windows-nat target becomes multi-process, then I guess we'll
Simon> use the passed-in pid to look up a specific windows_process_info by pid
Simon> in whatever data structure will contain all the windows_process_infos.
Simon> And then we can call windows_process_info::pid_to_exec_file without
Simon> passing any pid.

I think we'll still need to pass it, given that the Cygwin code needs
it.

Tom

  parent reply	other threads:[~2022-04-28 19:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27 17:27 [PATCH 0/2] " Tom Tromey
2022-04-27 17:27 ` [PATCH 1/2] Constify target_pid_to_exec_file Tom Tromey
2022-04-27 17:49   ` John Baldwin
2022-04-27 17:28 ` [PATCH 2/2] Implement pid_to_exec_file for Windows in gdbserver Tom Tromey
2022-04-28  1:33   ` Simon Marchi
2022-04-28 13:09     ` Tom Tromey
2022-04-28 19:50     ` Tom Tromey [this message]
2022-04-28 19: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=87mtg5kmwu.fsf@tromey.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).