microsoft / microsoft/vscode-mono-debug

debugger disconnect on embed mono

Open
#74 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
180
Forks
182
Avg merge
1d 8h
Merged PRs (30d)
1

Description

I embed mono by options:

const char* options[] = {
"--soft-breakpoints",
"--debugger-agent=transport=dt_socket,server=y,address=127.0.0.1:55555,timeout=9999999"
};
mono_jit_parse_options(sizeof(options) / sizeof(char*), (char**)options);

mono_debug_init(MONO_DEBUG_FORMAT_MONO);

mono debug can accept this socket ,but debug thread will get a disconnect event soon, then thread will exit:
res = transport_recv (header, HEADER_LENGTH);

	/* This will break if the socket is closed during shutdown too */
	if (res != HEADER_LENGTH) {
		PRINT_DEBUG_MSG (1, "[dbg] transport_recv () returned %d, expected %d.\n", res, HEADER_LENGTH);

this is the launch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "mono",
"request": "launch",
"program": "F:/TProject/Module/CSharpTestMono/bin/Debug/CSharpTestMono.exe",//"${workspaceRoot}/program.exe",
"cwd": "F:/TProject/Module/EmbedMono/x64/Debug"//"${workspaceRoot}"
},
{
"name": "Attach",
"type": "mono",
"request": "attach",
"address": "localhost",
"port": 55555,
},
]
}

I can debug by Launch,But Attach is not ok now.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Attach configuration in launch.json against the embedded Mono setup using port 55555. Inspect the debug thread around transport_recv and compare its behavior with the working Launch configuration; done means Attach stays connected and debugging can proceed.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.