Skip to content

Commit cb35df1

Browse files
committed
[debugger-agent]
- Fix mono_debugger_disconnect method so it disconnects the debugger client instead of trying to stop the debugger thread.
1 parent 3af2b9f commit cb35df1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

mono/mini/debugger-agent.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,12 +1091,18 @@ mono_debugger_get_generate_debug_info ()
10911091
return disable_optimizations;
10921092
}
10931093

1094+
// Declare transport_close2 method
1095+
static void transport_close2(void);
1096+
10941097
MONO_API void
10951098
mono_debugger_disconnect ()
10961099
{
1097-
stop_debugger_thread ();
1098-
transport_connect (agent_config.address);
1099-
start_debugger_thread ();
1100+
// We just need to close the debugger client socket since
1101+
// the thread is blocked in the RECV method. The debugger_thread
1102+
// loop already handles the debugger client disconnection properly,
1103+
// so calling transport_close2 method is enough since the method
1104+
// only closes the debugger client socket.
1105+
transport_close2();
11001106
}
11011107

11021108
typedef void (*MonoDebuggerAttachFunc)(gboolean attached);

0 commit comments

Comments
 (0)