Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/Enhancement - Improve mono-sdb implementation to allow remote debugging instances #298

Open
D-4-N opened this issue Feb 15, 2024 · 0 comments · May be fixed by #299
Open

Feature/Enhancement - Improve mono-sdb implementation to allow remote debugging instances #298

D-4-N opened this issue Feb 15, 2024 · 0 comments · May be fixed by #299

Comments

@D-4-N
Copy link

D-4-N commented Feb 15, 2024

dnSpy's current mono sdb implementation makes assumptions that prevent remote debugging instances

The current implementation is as follows:

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.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant