From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonic311-30.consmr.mail.ir2.yahoo.com (sonic311-30.consmr.mail.ir2.yahoo.com [77.238.176.162]) by sourceware.org (Postfix) with ESMTPS id 6D19C385E003 for ; Wed, 25 Mar 2020 14:35:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6D19C385E003 X-YMail-OSG: vd1UUZcVM1npoMvgKlFdJ4KAvOSZUg0U_KfXipc5YABT1kARyL5y6Lae5AgsSl6 dolCNaDOIAz4jdZ1W8WoWIr7RHyhtf0flqA8sQ26lIk61e.ZN4FlC6LRFZOTFRl6rJYCSOOY1ZwV swIfgXlXx8OjMnODPsJfwAYpEW4oBk3cSZ59ziaTVFoRh5wA.or18cn5tNKDCa_twLAAF.kqgo5T ha3bsS1I2tAbAFfhk56bSkMAXSJk1pGXCYekFDZ9V6YO9kWC_XnfOZXHgVQCTCESN.ZSFQ1.aFN5 tHhzfo9JHJ55BYvcYm7O6B_Kgp4CZLHR0oG5unYDP0OtRQZJW0qHTUGmQDMvVKV8SxZNRHUkVUkD chme6ErQNQTyto1RksAsaO6TwnMJMq2yU9tx0LC15pLecMgalHR8JUT8ph2nxCGy1ldIKkLR0CDb X7dSapsrODXygFzcZaSr0D6nsifDSce2bBby_TE.rQDLKIObKJpx8vmkP0Q3wh11m0WVs326AxTX vIC00d0JzyZri8RyQocRcwC0OTj_TuM2bjZFwye75b257ycBJO8Nb.IBXvrW4FoCb6pKQT1sEqnW 18ceqRfDBcko1rYEIHKnHzN2mhkLk1hczQN9G62qCxEpOxCq0P2IYQIUhN.kJe3tgtHIdnjrRXAz cYTUahK0ZsxPjrSweo_I2J9XLhiOxVXRxhA2WFiH4c41Qpr9tMMUyDmIM2j2benYXD6mvwkTHurS Rabom26sZ79NVsLYjce47Yc853HMomQY6gjOk7f5duvRF03WsOTFqQbQzNFbMi_Jh55uUUgWVz57 ttW_XPWDDB3.alr97OuvgT2cRQuYMh47poakUaButMYdpkw2kdBZxxjx6JsAdkh0UqL6swOOt8g9 s1ajvA1V2HYV8DWRnrn1TRz.cGch4ihDPSb89rLIHll2ZUcgiFv2EnOSoNxfxpKiKVfNH8nZs0kN FXLPH148nJQMxRfpJDHN1Htr9AOjkVgmgRw5WWP3zI5yD9ah5daG9iDIlZmR_HHLMsRjRadEIZxf FqU0ohQaXRs.bZpWnzRoA_4gUfrmd45fhj92459jd3OZaFfrQ0LWGWYjIUiVyexpjrW5IcL1Laxe 1o_DGTKjoiPzq_5XUEdkW6UZgobWYhUMhdCj99S7H_hJr3xNxucH16U5G1IIfJdn2kYTehVRQ7Iz w.HamLL_UzfF7hnR8pZRGXqs_1GIKsDscQBQ_2fInuCUkKNiALVT0F41AujF9KCdAbsUvANG9ZEk 3n4suPlsc0kp3QiD102zX2J8M_PKyfWsCipWAnI7afOD1hDdgPWuD3SJiqTVIuqSPs03.MPPxbdi SCx8ZgGyeiFC2wg-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.ir2.yahoo.com with HTTP; Wed, 25 Mar 2020 14:35:53 +0000 Date: Wed, 25 Mar 2020 14:35:51 +0000 (UTC) From: Hannes Domani To: Gdb-patches Message-ID: <30076034.3775038.1585146951973@mail.yahoo.com> In-Reply-To: <1d7bb2df-1f3e-9ff7-ea38-05db350192d2@simark.ca> 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> Subject: Re: [PATCH v2] Fix WOW64 process system DLL paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.15518 YMailNorrin Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0 X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GARBLED_BODY, GIT_PATCH_2, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, 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: Wed, 25 Mar 2020 14:35:56 -0000 Am Mittwoch, 25. M=C3=A4rz 2020, 15:23:44 MEZ hat Simon Marchi Folgendes geschrieben: > On 2020-03-25 10:22 a.m., Hannes Domani via Gdb-patches wrote: > >=C2=A0 Am Mittwoch, 25. M=C3=A4rz 2020, 15:04:44 MEZ hat Simon Marchi Folgendes geschrieben: > > > >> 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 architectu= re i386:x86-64 is not compatible with target architecture i386. > >>> > >>> Temporary breakpoint 1, main () at fiber.cpp:430 > >>> 430=C2=A0=C2=A0=C2=A0 { > >>> (gdb) info sharedlibrary > >>> From=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 To=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Syms Read=C2=A0 Shared Object Library > >>> 0x77070000=C2=A0 0x771d4d20=C2=A0 Yes (*)=C2=A0=C2=A0=C2=A0 C:\Window= s\SysWOW64\ntdll.dll > >>> 0x74dc0000=C2=A0 0x74ebad9c=C2=A0 Yes (*)=C2=A0=C2=A0=C2=A0 C:\Window= s\syswow64\kernel32.dll > >>> 0x75341000=C2=A0 0x75386a18=C2=A0 Yes (*)=C2=A0=C2=A0=C2=A0 C:\Window= s\syswow64\KernelBase.dll > >>> 0x6f6a1000=C2=A0 0x6f7c48fc=C2=A0 Yes (*)=C2=A0=C2=A0=C2=A0 C:\Window= s\system32\dbghelp.dll > >>> 0x74d01000=C2=A0 0x74dab2c4=C2=A0 Yes (*)=C2=A0=C2=A0=C2=A0 C:\Window= s\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=C2=A0 Hannes Domani=C2=A0 > >>> > >>>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * 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 > >> > >> > >> Btw, I found this Stack Overflow question that seems to be about this = exact > >> problem (which you may have already found too if you researched the to= pic), > >> but honestly I don't understand a thing from the answer. > >> > >>=C2=A0=C2=A0=C2=A0 https://stackoverflow.com/questions/46403532/getmodu= lefilenameex-on-32bit-process-from-64bit-process-on-windows-10 > > > > Yes, I did see this when I googled this problem. > > Basically, if you use GetMappedFileName instead of GetModuleFileNameEx,= you > > get the correct path (I tested this also), but it's returned in the nt-= path > > format: > > \Device\HarddiskVolume9\Windows\SysWOW64\dbghelp.dll > > > > Which you then have to convert to the "normal" path every one else expe= cts. > > But I figured my way with GetSystemWow64Directory is simpler. > > > > > > Is the v2 OK to commit? > > Yes, thanks. Pushed, thanks. Hannes