From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 91B253942027 for ; Thu, 26 Mar 2020 20:56:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 91B253942027 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 0E1381E60C; Thu, 26 Mar 2020 16:56:58 -0400 (EDT) Subject: Re: [PATCH v2] Fix WOW64 process system DLL paths To: Hannes Domani , Gdb-patches References: <20200324192351.3904-1-ssbssa.ref@yahoo.de> <20200324192351.3904-1-ssbssa@yahoo.de> <6fcfc7b1-5b1d-1bca-5bd8-06b075d626e6@simark.ca> <840438313.3764470.1585146130281@mail.yahoo.com> <1d7bb2df-1f3e-9ff7-ea38-05db350192d2@simark.ca> <30076034.3775038.1585146951973@mail.yahoo.com> <831rpf9bol.fsf@gnu.org> <692595410.5392254.1585254931564@mail.yahoo.com> <1525100081.5445433.1585255715401@mail.yahoo.com> From: Simon Marchi Message-ID: <532d1a18-76d1-2bda-c252-7dd001e6a8d1@simark.ca> Date: Thu, 26 Mar 2020 16:56:58 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <1525100081.5445433.1585255715401@mail.yahoo.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US-large Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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, 26 Mar 2020 20:57:00 -0000 On 2020-03-26 4:48 p.m., Hannes Domani via Gdb-patches wrote: > Am Donnerstag, 26. März 2020, 21:39:27 MEZ hat Christian Biesinger Folgendes geschrieben: > >> On Thu, Mar 26, 2020 at 3:35 PM Hannes Domani via Gdb-patches >> >> wrote: >>> >>>   Am Donnerstag, 26. März 2020, 20:26:14 MEZ hat Eli Zaretskii Folgendes geschrieben: >>> >>>>> Date: Wed, 25 Mar 2020 14:35:51 +0000 (UTC) >>>> >>>>> From: Hannes Domani via Gdb-patches >>>>> >>>>>>> But I figured my way with GetSystemWow64Directory is simpler. >>>>>>> >>>>>>> >>>>>>> Is the v2 OK to commit? >>>>>> >>>>>> Yes, thanks. >>>>> >>>>> Pushed, thanks. >>>> >>>> >>>> It looks like the same problem exists in the 32-bit Windows build of >>>> GDB, when it runs on 64-bit Windows 10: "info sharedlibrary" shows >>>> C:\Windows\system32 instead of C:\Windows\SysWOW64 (it doesn't happen >>>> on 64-bit Windows 7, for example).  So I guess the code which replaces >>>> the former with the latter should also be in the 32-bit build, not >>>> just "#ifdef __x86_64__". >>> >>> Yes, for me (on Win7) it also happens with the same dlls in the 32-bit gdb >>> as with the 64-bit gdb. >>> But it shouldn't matter, since for 32-bit gdb all C:\Windows\system32 paths >>> are automatically redirected[1] to C:\Windows\SysWOW64 anyways. >>> >>> [1] https://docs.microsoft.com/en-us/windows/win32/winprog64/file-system-redirector >> >> >> Even so, it's probably less confusing for the user if what GDB >> displays actually matches reality? > > I guess you are right. > I will prepare a patch for this. Let's say a 32 bit GDB is debugging a 64 bit program. GDB gets the list of loaded libraries, which contains c:\windows\system32\foo.dll. When GDB opens it, to read the contents of the library, will it open and read c:\windows\system32\foo.dll (which is the one really loaded in the 64-bit process) or will it open and read c:\windows\syswow64\foo.dll? Simon