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 AAD65385B834 for ; Tue, 24 Mar 2020 22:10:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AAD65385B834 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 412EA1E5F8; Tue, 24 Mar 2020 18:10:28 -0400 (EDT) Subject: Re: [PATCH v2] Fix WOW64 process system DLL paths To: Hannes Domani , gdb-patches@sourceware.org References: <20200324192351.3904-1-ssbssa.ref@yahoo.de> <20200324192351.3904-1-ssbssa@yahoo.de> From: Simon Marchi Message-ID: <31b0ab19-2d9a-3d8e-b337-413bd35b4424@simark.ca> Date: Tue, 24 Mar 2020 18:10:27 -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: <20200324192351.3904-1-ssbssa@yahoo.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US-large Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-18.7 required=5.0 tests=BAYES_00, GIT_PATCH_2, 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: Tue, 24 Mar 2020 22:10:29 -0000 On 2020-03-24 3:23 p.m., Hannes Domani via Gdb-patches wrote: > GetModuleFileNameEx returns for some DLLs of WOW64 processes > the path inside the 64bit system directory instead of the 32bit > syswow64 directory. > > Problem happens e.g. with dbghelp.dll: > > (gdb) start > Temporary breakpoint 1 at 0x415a00: file fiber.cpp, line 430. > Starting program: C:\src\tests\fiber.exe > warning: `C:\Windows\system32\dbghelp.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386. > > Temporary breakpoint 1, main () at fiber.cpp:430 > 430 { > (gdb) info sharedlibrary > From To Syms Read Shared Object Library > 0x77070000 0x771d4d20 Yes (*) C:\Windows\SysWOW64\ntdll.dll > 0x74dc0000 0x74ebad9c Yes (*) C:\Windows\syswow64\kernel32.dll > 0x75341000 0x75386a18 Yes (*) C:\Windows\syswow64\KernelBase.dll > 0x6f6a1000 0x6f7c48fc Yes (*) C:\Windows\system32\dbghelp.dll > 0x74d01000 0x74dab2c4 Yes (*) C:\Windows\syswow64\msvcrt.dll > (*): Shared library is missing debugging information. > > This detects this situation and converts the DLL path to the > syswow64 equivalent. > > gdb/ChangeLog: > > 2020-03-24 Hannes Domani > > * windows-nat.c (windows_add_all_dlls): Fix system dll paths. > --- > v2: > - added error check with gdb_assert's > - use std::string for newly assembled dll path Thanks, this is ok. Simon