https://bugs.winehq.org/show_bug.cgi?id=57266
Bug ID: 57266 Summary: Unable to use remote debugger with wine Product: Wine Version: 9.0 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: tapika@yahoo.com Distribution: ---
Created attachment 77191 --> https://bugs.winehq.org/attachment.cgi?id=77191 Logs from msvsmon
Wine as additional compatibility layer for linux is quite awesome, as it allows to run windows application in linux out of box. (Without actually porting them to linux).
This would save porting time and effort if debugging with wine would work out of box.
I have placed .net 4.8 framework executable into Wine64. Please note that running given executable does not work because of some error occurring in .net framework.
I think it's irrelevant which error or exception occurs at that point of time, but it should be possible to debug that exception using remote tools for that purpose.
Remote Debugging - overview: https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugging?vie...
From here: https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugging-cpp...
Download tools for remote debugging for Visual studio you're using. In my case it was "Visual Studio 2022", 'AMD64' architecture.
Install it on wine64 (don't remember exact commands, but normal execution)
Run following commands:
wine64 cmd c: cd "C:\Program Files\Microsoft Visual Studio 17.0\Common7\IDE\Remote Debugger\x64" msvsmon.exe /installed /nofirewallwarn /noauth /anyuser /nosecuritywarn
This will start remote tools on port 4026.
From Visual studio, C++ project, Project properties > Debugging.
Debugger to launch: Remote Windows Debugger.
Remote Command: Z:\home<path to executable> Working directory: Z:\home<path to directory of executable> Remote server name: localhost:4026 (I have used windows 11, wsl installation, ubuntu distribution) Connection: Remote with no authentication Debugger type: 1. Native Only 2. Mixed (.NET Framework)
1 gives in Visual studio following error:
Unable to start program 'Z:\home....exe'.
Catastrophic failure
2 gives in Visual studio following error:
Unable to start program 'Z:\home....exe'.
Not implemented
During 1 & 2 I can see following messages - see logs.txt
Can this be fixed somehow ?
https://bugs.winehq.org/show_bug.cgi?id=57266
--- Comment #1 from Austin English austinenglish@gmail.com --- Can you try with native .NET installed (winetricks dotnet462)?
https://bugs.winehq.org/show_bug.cgi?id=57266
--- Comment #2 from Tarmo Pikaro tapika@yahoo.com --- (In reply to Austin English from comment #1)
Can you try with native .NET installed (winetricks dotnet462)?
I've installed 4.8 previously, but now also tried your command, but same errors occurs.
https://bugs.winehq.org/show_bug.cgi?id=57266
Eric Pouech eric.pouech@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |eric.pouech@gmail.com
--- Comment #3 from Eric Pouech eric.pouech@gmail.com --- this works here
you need native webservices DLL to make it work and don't forget to open the ports on your firewall (need tcp for normal communication, and udp for discovery - from VS remote attachment dialog)
https://bugs.winehq.org/show_bug.cgi?id=57266
--- Comment #4 from Tarmo Pikaro tapika@yahoo.com --- I suspect that all necessary dependencies are installed.
I've took dependency walker from https://www.dependencywalker.com/ downloaded mfc42.dll manually from my c:\Windows\System32 folder, then started dependency walker on msvsmon.exe - all dependencies seems to be present.
Not sure about which "native webservices DLL" you're talking about. (How can that be installed ?)
https://bugs.winehq.org/show_bug.cgi?id=57266
--- Comment #5 from Eric Pouech eric.pouech@gmail.com --- (In reply to Tarmo Pikaro from comment #4)
I suspect that all necessary dependencies are installed.
I've took dependency walker from https://www.dependencywalker.com/ downloaded mfc42.dll manually from my c:\Windows\System32 folder, then started dependency walker on msvsmon.exe - all dependencies seems to be present.
Not sure about which "native webservices DLL" you're talking about. (How can that be installed ?)
you need to copy it from a windows installation (alongside msvsmon.exe's DLL, likely in x64 subdir) and run wine with WINEDLLOVERRIDES=webservices=n (see Wine user guide for details aboute native vs builtin) HTH
https://bugs.winehq.org/show_bug.cgi?id=57266
--- Comment #6 from Tarmo Pikaro tapika@yahoo.com ---
you need to copy it from a windows installation (alongside msvsmon.exe's DLL, likely in x64 subdir) and run wine with WINEDLLOVERRIDES=webservices=n (see Wine user guide for details aboute native vs builtin) HTH
Ah. Neat trick to cheat Wine to work with native .dll's in windows. I however was looking for permanent solution - so wine + msvsmon.exe would work also in linux docker container with possibility to debug remotely.
https://bugs.winehq.org/show_bug.cgi?id=57266
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW
--- Comment #7 from Austin English austinenglish@gmail.com --- (In reply to Tarmo Pikaro from comment #6)
you need to copy it from a windows installation (alongside msvsmon.exe's DLL, likely in x64 subdir) and run wine with WINEDLLOVERRIDES=webservices=n (see Wine user guide for details aboute native vs builtin) HTH
Ah. Neat trick to cheat Wine to work with native .dll's in windows. I however was looking for permanent solution - so wine + msvsmon.exe would work also in linux docker container with possibility to debug remotely.
It's still a valid bug, that's just a workaround, not the final fix :).