Skip to content

Commit c2e4469

Browse files
committed
Упрощение логики проверки от кролика
1 parent f5368f9 commit c2e4469

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

src/VSCode.DebugAdapter/DebugeeProcess.cs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -235,17 +235,23 @@ public void Kill()
235235

236236
public void SetExceptionsBreakpoints((string Id, string Condition)[] filters)
237237
{
238-
if (ProtocolVersion > ProtocolVersions.Version1 && ProtocolVersion < ProtocolVersions.Version3)
238+
switch (ProtocolVersion)
239239
{
240-
_debugger.SetMachineExceptionBreakpoints(filters);
241-
}
242-
else if (ProtocolVersion >= ProtocolVersions.Version3)
243-
{
244-
_debugger.SetExceptionBreakpoints(filters.Select(t => new ExceptionBreakpointFilter
245-
{
246-
Id = t.Id,
247-
Condition = t.Condition
248-
}).ToArray());
240+
case ProtocolVersions.UnknownVersion:
241+
case ProtocolVersions.Version1:
242+
// Version 1 doesn't support exception breakpoints
243+
Log.Warning("Exception breakpoints not supported in protocol version {Version}", ProtocolVersion);
244+
break;
245+
case ProtocolVersions.Version2:
246+
_debugger.SetMachineExceptionBreakpoints(filters);
247+
break;
248+
default: // Version 3 and higher
249+
_debugger.SetExceptionBreakpoints(filters.Select(t => new ExceptionBreakpointFilter
250+
{
251+
Id = t.Id,
252+
Condition = t.Condition
253+
}).ToArray());
254+
break;
249255
}
250256
}
251257

0 commit comments

Comments
 (0)