forked from microsoft/vscode-mono-debug
-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathMain.cs
More file actions
57 lines (48 loc) · 1.86 KB
/
Copy pathMain.cs
File metadata and controls
57 lines (48 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Original work by:
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Modified by:
/*---------------------------------------------------------------------------------------------
* Copyright (c) NEXON Korea Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
using System;
using System.Windows.Forms;
namespace VSCodeDebug
{
internal class Program
{
public static WaitingUI WaitingUI;
private static void Main(string[] argv)
{
WaitingUI = new WaitingUI();
Application.Run(WaitingUI);
}
private static ICDPSender toVSCode;
public static void Stop()
{
if (toVSCode != null) {
toVSCode.SendMessage(new TerminatedEvent());
}
}
public static void DebugSessionLoop()
{
try
{
// 우선 VS Code와의 통신을 조립한다.
// 디버기와의 통신은 launch 명령어 실행 이후에 조립한다.
var debugSession = new DebugSession();
var cdp = new VSCodeDebugProtocol(debugSession);
debugSession.toVSCode = cdp;
toVSCode = cdp;
cdp.Loop(Console.OpenStandardInput(), Console.OpenStandardOutput());
}
catch (Exception e)
{
MessageBox.OK(e.ToString());
}
}
}
}