-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathProgram.cs
More file actions
47 lines (43 loc) · 1.39 KB
/
Copy pathProgram.cs
File metadata and controls
47 lines (43 loc) · 1.39 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
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
namespace NSE.DebuggerFrontend
{
class Program
{
static void Main(string[] args)
{
var currentPath = AppDomain.CurrentDomain.BaseDirectory;
var dap = new DAPStream();
FileStream logFile = null;
try
{
logFile = new FileStream(currentPath + "\\DAP.log", FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite);
dap.EnableLogging(logFile);
var dapHandler = new DAPMessageHandler(dap);
dapHandler.EnableLogging(logFile);
dap.RunLoop();
}
catch (Exception e)
{
dap.SendEvent("output", new DAPOutputMessage
{
category = "important",
output = e.ToString()
});
dap.SendErrorReply(1, "initialize", "Internal error during initialization:\r\n" + e.ToString());
if (logFile != null)
{
using (var writer = new StreamWriter(logFile, Encoding.UTF8, 0x1000, true))
{
writer.Write(e.ToString());
}
}
}
}
}
}