From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) by sourceware.org (Postfix) with ESMTPS id 08D223858D1E for ; Thu, 28 Apr 2022 19:50:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 08D223858D1E Received: by mail-il1-x12a.google.com with SMTP id z12so2671732ilp.8 for ; Thu, 28 Apr 2022 12:50:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=uFohyy/f1iiNfLoG3xM8SVNNyv3hYuLEyFqlIoDpwjI=; b=gPgW3fja8cjOpKkcDUzvlaiBE+l5C58JECKSPieoQv2a5/armEnv8Utf39t91hn9w8 FRIXZu/o7UrLR1eByAqQz+JJGOVJmxra09t6cSpcNZqSveeFBh5PGDgoxv0K7Lhb4nP3 upC/mDr7FJ4XVuOkL7Z+uIhjuTGye+XmY9jZ5zI6bQjN88MR0hM1fXclD+Quw8abwmfH gTt53hCBMbi4mfQxIGpYtqvENTAur0H1cSmbQw56UkzOjRYxe/9VAmnNJfq0KCYs8zgW LatRDpkcafatiaoMnTq8zRg7X1+yqU8IXGI57+f3X3mSXNR5psDhM7XNpcw6rE9M4+j6 /FmQ== X-Gm-Message-State: AOAM531pUfb6M5vpzxH7DCvIOzDnj/HRDmsAeDG+u1OvITvdTISTdmbA 05yMm3bJ7cfMX5gmK7ekCcxRY26d3iBjgg== X-Google-Smtp-Source: ABdhPJxI1/6VwNXNTBdxaSD9ViORGxpqCdSakPDrJPV0pgOmF/ccwgeuHSNECvYVzvG2pgFhGWfvHQ== X-Received: by 2002:a05:6e02:1d9b:b0:2cd:8857:33e2 with SMTP id h27-20020a056e021d9b00b002cd885733e2mr11312895ila.80.1651175427266; Thu, 28 Apr 2022 12:50:27 -0700 (PDT) Received: from murgatroyd (71-211-158-194.hlrn.qwest.net. [71.211.158.194]) by smtp.gmail.com with ESMTPSA id x2-20020a056e020f0200b002cd588f744bsm425688ilj.71.2022.04.28.12.50.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Apr 2022 12:50:26 -0700 (PDT) From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH 2/2] Implement pid_to_exec_file for Windows in gdbserver References: <20220427172800.858822-1-tromey@adacore.com> <20220427172800.858822-3-tromey@adacore.com> <52345d0e-12bf-bbd8-0ec6-fdfd6b5487ef@simark.ca> X-Attribution: Tom Date: Thu, 28 Apr 2022 13:50:25 -0600 In-Reply-To: <52345d0e-12bf-bbd8-0ec6-fdfd6b5487ef@simark.ca> (Simon Marchi's message of "Wed, 27 Apr 2022 21:33:51 -0400") Message-ID: <87mtg5kmwu.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2022 19:50:29 -0000 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