forked from dnSpy/dnSpy
-
-
Notifications
You must be signed in to change notification settings - Fork 631
Open
Description
dnSpy's current mono sdb implementation makes assumptions that prevent remote debugging instances
The current implementation is as follows:
dnSpy/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.Mono/Impl/DbgEngineImpl.cs
Lines 440 to 454 in b12cbff
| var ep = (IPEndPoint)vm.EndPoint; | |
| var pid = NetUtils.GetProcessIdOfListener(ep.Address.MapToIPv4().GetAddressBytes(), (ushort)ep.Port); | |
| Debug.Assert(expectedPid == -1 || expectedPid == pid); | |
| if (pid is null) | |
| throw new StartException(dnSpy_Debugger_DotNet_Mono_Resources.Error_CouldNotFindDebuggedProcess); | |
| vmPid = pid.Value; | |
| hProcess_debuggee = NativeMethods.OpenProcess(NativeMethods.PROCESS_QUERY_LIMITED_INFORMATION, false, (uint)vmPid); | |
| dbgManager.WriteMessage(string.Format(dnSpy_Debugger_DotNet_Mono_Resources.MonoDebuggerConnectionMessage, ep, vm.Version.VMVersion, $"{vm.Version.MajorVersion}.{vm.Version.MinorVersion}")); | |
| var eventThread = new Thread(MonoEventThread); | |
| eventThread.IsBackground = true; | |
| eventThread.Name = "MonoDebugEvent"; | |
| eventThread.Start(); |
While this works for local debugging instances, it fails to do so when attempting to attach to remote mono instances, showing the following message in the process.
sunnamed434, StonedHackerman and JBou
Metadata
Metadata
Assignees
Labels
No labels
