-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathEventRequestModifier.cs
More file actions
173 lines (145 loc) · 4.58 KB
/
Copy pathEventRequestModifier.cs
File metadata and controls
173 lines (145 loc) · 4.58 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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
namespace Tvl.Java.DebugInterface.Types
{
using System.Runtime.Serialization;
[DataContract]
public struct EventRequestModifier
{
[DataMember(IsRequired = true)]
public ModifierKind Kind;
/// <summary>
/// Count before event, or one for one-off.
/// </summary>
[DataMember]
public int Count;
[DataMember]
public int ExpressionId;
[DataMember]
public ThreadId Thread;
[DataMember]
public ReferenceTypeId Class;
// used by ClassMatch and ClassExclude modifiers
[DataMember]
public string ClassPattern;
[DataMember]
public Location Location;
[DataMember]
public ReferenceTypeId ExceptionOrNull;
[DataMember]
public bool Caught;
[DataMember]
public bool Uncaught;
[DataMember]
public ReferenceTypeId DeclaringClass;
[DataMember]
public FieldId Field;
[DataMember]
public StepSize StepSize;
[DataMember]
public StepDepth StepDepth;
[DataMember]
public ObjectId Instance;
[DataMember]
public string SourceNamePattern;
public static EventRequestModifier CountFilter(int count)
{
return new EventRequestModifier()
{
Kind = ModifierKind.Count,
Count = count,
};
}
public static EventRequestModifier ConditionalFilter(int expressionId)
{
return new EventRequestModifier()
{
Kind = ModifierKind.Conditional,
ExpressionId = expressionId,
};
}
public static EventRequestModifier ThreadFilter(ThreadId thread)
{
return new EventRequestModifier()
{
Kind = ModifierKind.ThreadFilter,
Thread = thread,
};
}
public static EventRequestModifier ClassTypeFilter(ReferenceTypeId @class)
{
return new EventRequestModifier()
{
Kind = ModifierKind.ClassTypeFilter,
Class = @class,
};
}
public static EventRequestModifier ClassMatchFilter(string classPattern)
{
return new EventRequestModifier()
{
Kind = ModifierKind.ClassMatchFilter,
ClassPattern = classPattern,
};
}
public static EventRequestModifier ClassExcludeFilter(string classPattern)
{
return new EventRequestModifier()
{
Kind = ModifierKind.ClassExcludeFilter,
ClassPattern = classPattern,
};
}
public static EventRequestModifier LocationFilter(Location location)
{
return new EventRequestModifier()
{
Kind = ModifierKind.LocationFilter,
Location = location,
};
}
public static EventRequestModifier ExceptionFilter(ReferenceTypeId exceptionOrNull, bool caught, bool uncaught)
{
return new EventRequestModifier()
{
Kind = ModifierKind.ExceptionFilter,
ExceptionOrNull = exceptionOrNull,
Caught = caught,
Uncaught = uncaught,
};
}
public static EventRequestModifier FieldFilter(ReferenceTypeId declaringClass, FieldId field)
{
return new EventRequestModifier()
{
Kind = ModifierKind.FieldFilter,
DeclaringClass = declaringClass,
Field = field,
};
}
public static EventRequestModifier Step(ThreadId thread, StepSize size, StepDepth depth)
{
return new EventRequestModifier()
{
Kind = ModifierKind.Step,
Thread = thread,
StepSize = size,
StepDepth = depth,
};
}
public static EventRequestModifier InstanceFilter(ObjectId instance)
{
return new EventRequestModifier()
{
Kind = ModifierKind.InstanceFilter,
Instance = instance,
};
}
public static EventRequestModifier SourceNameMatch(string sourceNamePattern)
{
return new EventRequestModifier()
{
Kind = ModifierKind.SourceNameMatchFilter,
SourceNamePattern = sourceNamePattern,
};
}
}
}