-
Notifications
You must be signed in to change notification settings - Fork 1
/
Events.cs
90 lines (75 loc) · 2.03 KB
/
Events.cs
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
namespace OpenDebug
{
public class DebugEvent
{
public string type { get; set; }
public DebugEvent(string typ) {
type = typ;
}
}
public class InitializedEvent : DebugEvent
{
public InitializedEvent() : base("initialized") {
}
}
public class StoppedEvent : DebugEvent
{
public int threadId { get; set; }
public string reason { get; set; }
public Source source { get; set; }
public int line { get; set; }
public int column { get; set; }
public string text { get; set; }
public StoppedEvent(string reasn, Source src, int ln, int col = 0, string txt = null, int tid = 0) : base("stopped") {
reason = reasn;
source = src;
line = ln;
column = col;
text = txt;
threadId = tid;
}
}
public class ExitedEvent : DebugEvent
{
public int exitCode { get; set; }
public ExitedEvent(int exCode) : base("exited") {
exitCode = exCode;
}
}
public class TerminatedEvent : DebugEvent
{
public TerminatedEvent() : base("terminated") {
}
}
public class ThreadEvent : DebugEvent
{
public string reason { get; set; }
public int threadId { get; set; }
public ThreadEvent(string reasn, int tid) : base("thread") {
reason = reasn;
threadId = tid;
}
}
public class OutputEvent : DebugEvent
{
public string category { get; set; }
public string output { get; set; }
public enum Category { console, stdout, stderr };
public OutputEvent(Category cat, string outpt) : base("output") {
if (cat == Category.stdout)
category = "stdout";
else if (cat == Category.stderr)
category = "stderr";
else
category = "console";
output = outpt;
}
public OutputEvent(string outpt) : this(Category.console, outpt)
{
}
}
}