-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/exception breakpoints #1434
Feature/exception breakpoints #1434
Conversation
WalkthroughThe recent changes significantly enhance debugging capabilities by introducing conditional breakpoints, exception filtering, and refined breakpoint management. Key features include new properties for conditions, updated interfaces for better error handling, and the addition of methods for setting machine exception breakpoints. These improvements collectively streamline the debugging process, providing developers with increased control and clarity in their coding sessions. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Debugger
participant BreakpointManager
participant DebugSession
User->>Debugger: Set Breakpoints with Conditions
Debugger->>BreakpointManager: Update Breakpoints
BreakpointManager->>Debugger: Acknowledge Update
Debugger->>DebugSession: Notify Breakpoint Hit
DebugSession->>User: Show Breakpoint Notification
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (2)
src/ScriptEngine/Machine/IDebugController.cs (1)
29-29
: Discrepancies inSetBreakpoints
Method SignaturesThe
SetBreakpoints
method signatures in the following files do not match the new signature(string module, (int Line, string Condition)[] breakpoints)
:
src/VSCode.DebugAdapter/OscriptDebugSession.cs
:public override void SetBreakpoints(Response response, dynamic arguments)
src/OneScript.DebugServices/DefaultDebugService.cs
:_breakpointManager.SetBreakpoints(item.Key, points)
Please update these method signatures to conform to the new interface.
Analysis chain
LGTM! But verify the method usage in the codebase.
The code changes are approved.
However, ensure that the method
SetBreakpoints
is correctly implemented and used.
The search results show multiple occurrences of
SetBreakpoints
. We need to ensure that all instances match the new signature(string module, (int Line, string Condition)[] breakpoints)
.Let's verify each instance to confirm they adhere to the new method signature.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all method calls to `SetBreakpoints` match the new signature. # Test: Search for the method usage. Expect: Only occurrences of the new signature. rg --type cs -A 5 $'SetBreakpoints'Length of output: 5996
Script:
#!/bin/bash # Verify the method signatures for SetBreakpoints in all relevant files. # Check the method signature in src/VSCode.DebugAdapter/OscriptDebugSession.cs rg --type cs -A 5 'SetBreakpoints' src/VSCode.DebugAdapter/OscriptDebugSession.cs # Check the method signature in src/ScriptEngine/Machine/IDebugController.cs rg --type cs -A 5 'SetBreakpoints' src/ScriptEngine/Machine/IDebugController.cs # Check the method signature in src/OneScript.DebugServices/DefaultBreakpointManager.cs rg --type cs -A 5 'SetBreakpoints' src/OneScript.DebugServices/DefaultBreakpointManager.cs # Check the method signature in src/OneScript.DebugServices/DefaultDebugService.cs rg --type cs -A 5 'SetBreakpoints' src/OneScript.DebugServices/DefaultDebugService.csLength of output: 2204
src/OneScript.DebugServices/DefaultDebugService.cs (1)
71-83
: Ensure consistency inSetMachineBreakpoints
implementations.The method
SetMachineBreakpoints
inDefaultDebugService.cs
has been updated with new logic to handle breakpoints with conditions. However, the following files do not reflect this change:
src/VSCode.DebugAdapter/DebugeeProcess.cs
src/VSCode.DebugAdapter/OscriptProtocols/Tcp/TcpDebugServerClient.cs
src/OneScript.DebugProtocol/IDebuggerService.cs
Please update these implementations and usages to ensure they match the new logic introduced in
DefaultDebugService.cs
.Analysis chain
LGTM! But verify the function usage in the codebase.
The code changes are approved.
However, ensure that all function calls to
SetMachineBreakpoints
match the new logic.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `SetMachineBreakpoints` match the new logic. # Test: Search for the function usage. Expect: Only occurrences of the new logic. rg --type cs -A 5 $'SetMachineBreakpoints'Length of output: 2128
Script:
#!/bin/bash # Description: Verify all function calls to `SetMachineBreakpoints` match the new logic. # Check the implementation of SetMachineBreakpoints in DebugeeProcess.cs echo "Checking DebugeeProcess.cs..." rg --type cs -A 10 'SetMachineBreakpoints' src/VSCode.DebugAdapter/DebugeeProcess.cs # Check the implementation of SetMachineBreakpoints in TcpDebugServerClient.cs echo "Checking TcpDebugServerClient.cs..." rg --type cs -A 10 'SetMachineBreakpoints' src/VSCode.DebugAdapter/OscriptProtocols/Tcp/TcpDebugServerClient.cs # Check the implementation of SetMachineBreakpoints in IDebuggerService.cs echo "Checking IDebuggerService.cs..." rg --type cs -A 10 'SetMachineBreakpoints' src/OneScript.DebugProtocol/IDebuggerService.csLength of output: 1565
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
src/VSCode.DebugAdapter/package-lock.json
is excluded by!**/package-lock.json
Files selected for processing (19)
- src/OneScript.DebugProtocol/Breakpoint.cs (1 hunks)
- src/OneScript.DebugProtocol/IDebugEventListener.cs (1 hunks)
- src/OneScript.DebugProtocol/IDebuggerService.cs (1 hunks)
- src/OneScript.DebugServices/BreakpointDescriptor.cs (1 hunks)
- src/OneScript.DebugServices/DefaultBreakpointManager.cs (1 hunks)
- src/OneScript.DebugServices/DefaultDebugController.cs (2 hunks)
- src/OneScript.DebugServices/DefaultDebugService.cs (2 hunks)
- src/OneScript.DebugServices/TcpEventCallbackChannel.cs (1 hunks)
- src/OneScript.DebugServices/ThreadManager.cs (1 hunks)
- src/OneScript.DebugServices/ThreadStoppedEventArgs.cs (1 hunks)
- src/ScriptEngine/Machine/IDebugController.cs (1 hunks)
- src/ScriptEngine/Machine/MachineInstance.cs (6 hunks)
- src/ScriptEngine/Machine/MachineStopManager.cs (5 hunks)
- src/ScriptEngine/Machine/MachineStoppedEventArgs.cs (1 hunks)
- src/VSCode.DebugAdapter/DebugSession.cs (2 hunks)
- src/VSCode.DebugAdapter/DebugeeProcess.cs (1 hunks)
- src/VSCode.DebugAdapter/OscriptDebugSession.cs (5 hunks)
- src/VSCode.DebugAdapter/OscriptProtocols/Tcp/TcpDebugServerClient.cs (1 hunks)
- src/VSCode.DebugAdapter/package.json (7 hunks)
Files skipped from review due to trivial changes (1)
- src/VSCode.DebugAdapter/package.json
Additional comments not posted (43)
src/OneScript.DebugProtocol/Breakpoint.cs (1)
18-18
: LGTM! The addition of theCondition
property enhances debugging capabilities.The
Condition
property allows specifying conditions for breakpoints, which improves control over debugging.src/OneScript.DebugServices/ThreadStoppedEventArgs.cs (1)
20-20
: LGTM! The addition of theErrorMessage
property enhances the class's functionality.The
ErrorMessage
property allows storing an error message related to the thread's stop event, providing more context for debugging.src/OneScript.DebugServices/BreakpointDescriptor.cs (1)
16-16
: LGTM! The addition of theCondition
property enhances the functionality of the class.The
Condition
property allows storing a condition associated with a breakpoint, enabling conditional breakpoints.src/OneScript.DebugProtocol/IDebugEventListener.cs (1)
15-15
: LGTM! But verify the method usage in the codebase.The code changes are approved.
However, ensure that all method calls to
ThreadStopped
match the new signature.src/ScriptEngine/Machine/IDebugController.cs (5)
37-37
: LGTM! But verify the method usage in the codebase.The code changes are approved.
However, ensure that the method
GetCondition
is correctly implemented and used.Verification successful
The method
GetCondition
is correctly implemented and used. All occurrences match the new signature.
src/ScriptEngine/Machine/MachineStopManager.cs
src/ScriptEngine/Machine/IDebugController.cs
src/OneScript.DebugServices/DefaultBreakpointManager.cs
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all method calls to `GetCondition` match the new signature. # Test: Search for the method usage. Expect: Only occurrences of the new signature. rg --type cs -A 5 $'GetCondition'Length of output: 1447
35-35
: LGTM! But verify the method usage in the codebase.The code changes are approved.
However, ensure that the method
FindBreakpoint
is correctly implemented and used.Verification successful
Verified: The method
FindBreakpoint
is correctly implemented and used with the new signature.
IDebugController.cs
: Declaration ofFindBreakpoint
.MachineStopManager.cs
: Usage ofFindBreakpoint
.DefaultBreakpointManager.cs
: Implementation ofFindBreakpoint
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all method calls to `FindBreakpoint` match the new signature. # Test: Search for the method usage. Expect: Only occurrences of the new signature. rg --type cs -A 5 $'FindBreakpoint'Length of output: 1555
31-31
: LGTM! But verify the method usage in the codebase.The code changes are approved.
However, ensure that the method
StopInAnyException
is correctly implemented and used.Verification successful
Verification successful!
The method
StopInAnyException
is correctly implemented and used in the codebase.
- Defined in
src/ScriptEngine/Machine/IDebugController.cs
.- Used in
src/ScriptEngine/Machine/MachineInstance.cs
.- Implemented in
src/OneScript.DebugServices/DefaultBreakpointManager.cs
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all method calls to `StopInAnyException` match the new signature. # Test: Search for the method usage. Expect: Only occurrences of the new signature. rg --type cs -A 5 $'StopInAnyException'Length of output: 1580
33-33
: LGTM! But verify the method usage in the codebase.The code changes are approved.
However, ensure that the method
StopInUncaughtException
is correctly implemented and used.Verification successful
The method
StopInUncaughtException
is correctly implemented and used.
- Declaration:
src/ScriptEngine/Machine/IDebugController.cs
- Usage:
src/ScriptEngine/Machine/MachineInstance.cs
- Implementation:
src/OneScript.DebugServices/DefaultBreakpointManager.cs
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all method calls to `StopInUncaughtException` match the new signature. # Test: Search for the method usage. Expect: Only occurrences of the new signature. rg --type cs -A 5 $'StopInUncaughtException'Length of output: 1327
27-27
: LGTM! But verify the method usage in the codebase.The code changes are approved.
However, ensure that the method
SetExceptionBreakpoints
is correctly implemented and used.Verification successful
The method
SetExceptionBreakpoints
is correctly implemented and used.
- The method is defined in
IDebugController.cs
.- It is implemented in
DefaultBreakpointManager.cs
.- It is used in
DefaultDebugService.cs
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all method calls to `SetExceptionBreakpoints` match the new signature. # Test: Search for the method usage. Expect: Only occurrences of the new signature. rg --type cs -A 5 $'SetExceptionBreakpoints'Length of output: 4270
src/ScriptEngine/Machine/MachineStoppedEventArgs.cs (4)
18-19
: LGTM!The constructor now initializes the
ErrorMessage
property to an empty string, providing a default value.
22-26
: LGTM!The constructor now includes an optional
errorMessage
parameter, improving flexibility.
33-33
: LGTM!The
ErrorMessage
property is new and enhances the class by conveying error information.
39-39
: LGTM!The enum
MachineStopReason
has been extended with a new memberBreakpointConditionError
, enhancing the granularity of stop reasons.src/OneScript.DebugServices/TcpEventCallbackChannel.cs (1)
24-26
: LGTM! But verify the method usage in the codebase.The code changes are approved.
However, ensure that all method calls to
ThreadStopped
include the new parametererrorMessage
.Verification successful
All method calls to
ThreadStopped
include the new parametererrorMessage
.The code changes are correctly implemented, and all relevant method calls have been updated to include the new parameter.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all method calls to `ThreadStopped` include the new parameter `errorMessage`. # Test: Search for the method usage. Expect: Only occurrences of the new signature. rg --type cs -A 5 $'ThreadStopped'Length of output: 5116
src/OneScript.DebugServices/DefaultBreakpointManager.cs (6)
20-24
: LGTM! But verify the method usage in the codebase.The code changes are approved.
However, ensure that the method
SetExceptionBreakpoints
is used appropriately in the codebase.
50-51
: LGTM! But verify the method usage in the codebase.The code changes are approved.
However, ensure that the method
StopInAnyException
is used appropriately in the codebase.Verification successful
Method
StopInAnyException
is used appropriately in the codebase.
- The method is declared in
IDebugController.cs
.- The method is used in
MachineInstance.cs
to control the stopping mechanism for exceptions.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the method `StopInAnyException`. # Test: Search for the method usage. Expect: Appropriate usage of the method. rg --type cs -A 5 $'StopInAnyException'Length of output: 1580
53-54
: LGTM! But verify the method usage in the codebase.The code changes are approved.
However, ensure that the method
StopInUncaughtException
is used appropriately in the codebase.Verification successful
The method
StopInUncaughtException
is used appropriately in the codebase.
- The method is used in a conditional statement to determine if the execution should stop due to an uncaught exception.
- The context provided confirms that the method is part of the exception handling logic and is used correctly.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the method `StopInUncaughtException`. # Test: Search for the method usage. Expect: Appropriate usage of the method. rg --type cs -A 5 $'StopInUncaughtException'Length of output: 1327
Script:
#!/bin/bash # Description: Gather more context around the usage of `_stopManager.Breakpoints` in MachineInstance.cs # Test: Search for the usage of `_stopManager.Breakpoints` in MachineInstance.cs rg --type cs -A 10 $'_stopManager.Breakpoints' src/ScriptEngine/Machine/MachineInstance.csLength of output: 582
37-39
: LGTM! But verify the method usage in the codebase.The code changes are approved.
However, ensure that the method
FindBreakpoint
is used appropriately in the codebase.Verification successful
The method
FindBreakpoint
is used appropriately in the codebase.
- The method is used in
MachineStopManager
within theHitBreakpointOnLine
method to check if a breakpoint exists at a given module and line number.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the method `FindBreakpoint`. # Test: Search for the method usage. Expect: Appropriate usage of the method. rg --type cs -A 5 $'FindBreakpoint'Length of output: 1555
Script:
#!/bin/bash # Description: Gather more context around the usage of the method `FindBreakpoint` in `MachineStopManager`. # Extract 10 lines before and after the usage of `FindBreakpoint` in `MachineStopManager`. rg --type cs -A 10 -B 10 'FindBreakpoint' src/ScriptEngine/Machine/MachineStopManager.csLength of output: 695
26-34
: LGTM! But verify the method usage in the codebase.The code changes are approved.
However, ensure that the method
SetBreakpoints
is used appropriately in the codebase.
42-43
: LGTM! But verify the method usage in the codebase.The code changes are approved.
However, ensure that the method
GetCondition
is used appropriately in the codebase.Verification successful
The method
GetCondition
is used appropriately in the codebase.The code checks for a non-empty condition and evaluates it within a try-catch block, ensuring safe execution.
MachineStopManager.cs
: Verified usage ofGetCondition
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the method `GetCondition`. # Test: Search for the method usage. Expect: Appropriate usage of the method. rg --type cs -A 5 $'GetCondition'Length of output: 1447
Script:
#!/bin/bash # Description: Extract more context around the usage of the method `GetCondition` in `MachineStopManager.cs`. # Test: Search for the method usage and include more lines of context. rg --type cs -A 10 -B 10 $'GetCondition' src/ScriptEngine/Machine/MachineStopManager.csLength of output: 1130
src/OneScript.DebugProtocol/IDebuggerService.cs (1)
21-25
: LGTM! But verify the method usage in the codebase.The code changes are approved.
However, ensure that the method
SetMachineExceptionBreakpoints
is used appropriately in the codebase.Verification successful
The method
SetMachineExceptionBreakpoints
is used appropriately in the codebase.The method is correctly invoked and implemented in the following files:
src/VSCode.DebugAdapter/DebugeeProcess.cs
src/VSCode.DebugAdapter/OscriptProtocols/Tcp/TcpDebugServerClient.cs
src/OneScript.DebugServices/DefaultDebugService.cs
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the method `SetMachineExceptionBreakpoints`. # Test: Search for the method usage. Expect: Appropriate usage of the method. rg --type cs -A 5 $'SetMachineExceptionBreakpoints'Length of output: 2256
src/OneScript.DebugServices/ThreadManager.cs (1)
73-74
: LGTM! The addition ofErrorMessage
enhances debugging information.Including the
ErrorMessage
in theThreadStoppedEventArgs
provides additional context for debugging purposes.src/OneScript.DebugServices/DefaultDebugController.cs (3)
58-58
: LGTM! The addition ofErrorMessage
enhances debugging information.Including the
ErrorMessage
in the_callbackService.ThreadStopped
invocation provides additional context for debugging purposes.
63-63
: LGTM! The refactoring improves readability.Using expression-bodied members for the
Wait
andDetachFromThread
methods streamlines the code.Also applies to: 80-80
84-91
: LGTM! The switch expression modernizes the code.Using a switch expression reduces verbosity and the new case for
MachineStopReason.BreakpointConditionError
ensures all relevant cases are handled.src/ScriptEngine/Machine/MachineStopManager.cs (4)
45-45
: LGTM! The addition ofLastStopErrorMessage
enhances error handling.Adding
LastStopErrorMessage
provides feedback on errors encountered during debugging, improving the robustness of the debugging process.
73-97
: LGTM! The expanded logic improves error handling.The additional checks for breakpoint conditions and handling errors during their evaluation enhance the robustness of the debugging process.
120-120
: LGTM! The renaming improves clarity.Renaming
HitBreakpointOnLine
toFindBreakpoint
makes the method's functionality clearer.
148-148
: LGTM! The simplification enhances readability.Simplifying the default assignment from
default(StopPoint)
todefault
maintains functionality and improves code readability.src/VSCode.DebugAdapter/OscriptProtocols/Tcp/TcpDebugServerClient.cs (1)
136-139
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
SetMachineExceptionBreakpoints
match the new signature.Verification successful
Verify the function usage in the codebase.
The code changes are approved.
However, ensure that all function calls to
SetMachineExceptionBreakpoints
match the new signature.#!/bin/bash # Description: Verify the arguments passed to SetMachineExceptionBreakpoints in different files. # Check the context around each occurrence to ensure the correct usage. rg --type cs -A 5 'SetMachineExceptionBreakpoints' src/VSCode.DebugAdapter/DebugeeProcess.cs rg --type cs -A 5 'SetMachineExceptionBreakpoints' src/VSCode.DebugAdapter/OscriptProtocols/Tcp/TcpDebugServerClient.cs rg --type cs -A 5 'SetMachineExceptionBreakpoints' src/OneScript.DebugServices/DefaultDebugService.cs rg --type cs -A 5 'SetMachineExceptionBreakpoints' src/OneScript.DebugProtocol/IDebuggerService.csScripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `SetMachineExceptionBreakpoints` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type cs -A 5 $'SetMachineExceptionBreakpoints'Length of output: 2256
src/OneScript.DebugServices/DefaultDebugService.cs (1)
54-61
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
SetMachineExceptionBreakpoints
match the new signature.Verification successful
Verified: All occurrences of
SetMachineExceptionBreakpoints
match the new signature.
DebugeeProcess.cs
: The method is called with a string arrayfilters
.TcpDebugServerClient.cs
: The method is defined with a string arrayfilters
.IDebuggerService.cs
: The method is declared with a string arrayfilters
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `SetMachineExceptionBreakpoints` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type cs -A 5 $'SetMachineExceptionBreakpoints'Length of output: 2256
Script:
#!/bin/bash # Description: Gather more context around the occurrences of SetMachineExceptionBreakpoints # Check the context around the call in DebugeeProcess.cs rg --type cs -A 10 -B 10 'SetMachineExceptionBreakpoints' src/VSCode.DebugAdapter/DebugeeProcess.cs # Check the context around the definition in TcpDebugServerClient.cs rg --type cs -A 10 -B 10 'SetMachineExceptionBreakpoints' src/VSCode.DebugAdapter/OscriptProtocols/Tcp/TcpDebugServerClient.cs # Check the context around the declaration in IDebuggerService.cs rg --type cs -A 10 -B 10 'SetMachineExceptionBreakpoints' src/OneScript.DebugProtocol/IDebuggerService.csLength of output: 2229
src/VSCode.DebugAdapter/DebugeeProcess.cs (1)
204-207
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
SetExceptionsBreakpoints
match the new signature.Verification successful
Verify the function usage in the codebase.
The code changes are approved.
However, ensure that all function calls to
SetExceptionsBreakpoints
match the new signature. The current search shows one call inOscriptDebugSession.cs
that matches the new signature.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `SetExceptionsBreakpoints` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type cs -A 5 $'SetExceptionsBreakpoints'Length of output: 1062
src/VSCode.DebugAdapter/DebugSession.cs (3)
121-125
: Verify the appropriateness of the default value forline
.The constructor now defaults
line
to zero. Ensure this default value is appropriate for all use cases where the line number is not explicitly provided.
271-272
: LGTM!Using
Array.Empty<Breakpoint>()
instead of creating a new array optimizes memory usage.
277-287
: LGTM!The new
SetExceptionBreakpointsResponseBody
class mirrors the structure ofSetBreakpointsResponseBody
and is consistent with the existing codebase.src/VSCode.DebugAdapter/OscriptDebugSession.cs (4)
43-60
: LGTM!The changes to support conditional breakpoints and exception breakpoint filters enhance debugging capabilities.
165-182
: LGTM!The new
SetExceptionBreakpoints
method correctly processes incoming requests to set exception breakpoints.
212-217
: LGTM!The addition of the
Condition
property to theBreakpoint
object enhances flexibility in setting breakpoints.
250-258
: LGTM!The additional
errorMessage
parameter in theThreadStopped
method allows for more context when a thread is stopped.src/ScriptEngine/Machine/MachineInstance.cs (4)
76-77
: LGTM!Changing
CreateFrameScopes
to a static expression-bodied method simplifies its definition while retaining functionality.
Line range hint
243-262
: LGTM!The modification to accept an
ExecutionFrame
object instead of an integerframeId
enhances type safety and clarity.
292-301
: LGTM!The restructuring of
EvaluateInFrame
into an overload improves code readability and separates concerns effectively.
1305-1313
: LGTM!The new
EmitStopByException
method encapsulates the logic for emitting a stop event when an exception occurs, enhancing debugging capabilities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/VSCode.DebugAdapter/package.json (7 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/VSCode.DebugAdapter/package.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- src/OneScript.DebugServices/DefaultBreakpointManager.cs (2 hunks)
- src/ScriptEngine/Machine/IDebugController.cs (1 hunks)
- src/ScriptEngine/Machine/MachineInstance.cs (6 hunks)
Additional comments not posted (18)
src/ScriptEngine/Machine/IDebugController.cs (6)
27-27
: LGTM!The method
SetExceptionBreakpoints
is correctly defined to accept an array of string filters.
29-29
: LGTM!The method
SetBreakpoints
is correctly defined to accept a module and an array of tuples containing line numbers and conditions.
31-31
: LGTM!The method
StopOnAnyException
is correctly defined to return a boolean indicating whether to stop on any exception.
33-33
: LGTM!The method
StopOnUncaughtException
is correctly defined to return a boolean indicating whether to stop on uncaught exceptions.
35-35
: LGTM!The method
FindBreakpoint
is correctly defined and the new name improves clarity regarding its purpose.
37-37
: LGTM!The method
GetCondition
is correctly defined to return a string containing the condition associated with a specific breakpoint.src/OneScript.DebugServices/DefaultBreakpointManager.cs (6)
21-27
: LGTM!The method
SetExceptionBreakpoints
correctly handles exception breakpoints by clearing and setting filters.
29-37
: LGTM!The method
SetBreakpoints
correctly handles breakpoints by associating conditions with specific lines.
40-42
: LGTM!The method
FindBreakpoint
correctly checks for the existence of a breakpoint and the new name improves clarity.
45-46
: LGTM!The method
GetCondition
correctly retrieves the condition associated with a specific breakpoint.
53-54
: LGTM!The method
StopOnAnyException
correctly checks if the manager should stop execution on all exceptions.
56-57
: LGTM!The method
StopOnUncaughtException
correctly checks if the manager should stop execution on uncaught exceptions.src/ScriptEngine/Machine/MachineInstance.cs (6)
76-77
: LGTM!The method
CreateFrameScopes
has been correctly simplified to a static expression-bodied method.
Line range hint
243-262
: LGTM!The method
EvaluateInFrame
has been correctly modified to accept anExecutionFrame
object, enhancing type safety and clarity.
292-301
: LGTM!The original implementation of
EvaluateInFrame
has been correctly moved to a new overload, improving code readability and separating concerns.
411-417
: LGTM!The logic for handling exceptions during code execution has been correctly expanded with the introduction of the
shouldRethrow
variable, enhancing control flow.
1305-1313
: LGTM!The method
EmitStopOnException
correctly encapsulates the logic for emitting a stop event when an exception occurs, enhancing debugging capabilities.
1314-1321
: LGTM!The method
EmitStopEventIfNecessary
has been correctly updated to include a call toEmitStopOnException
, aligning with the overall enhancements to exception handling and debugging.
{ | ||
filter = "uncaught", | ||
label = "Uncaught exceptions", | ||
description = "Stops when any uncaught exception occurs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Давай на русском напишем? Все-таки наша аудитория русскоязычная на 99.99999%
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сделал
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/VSCode.DebugAdapter/OscriptDebugSession.cs (5 hunks)
Additional comments not posted (5)
src/VSCode.DebugAdapter/OscriptDebugSession.cs (5)
43-43
: Support for Conditional Breakpoints Added.The property
supportsConditionalBreakpoints
is now set totrue
, enabling conditional breakpoints.
46-60
: Exception Breakpoint Filters Added.Two new exception breakpoint filters have been added: "uncaught" and "all". This enhances the debugging capabilities by allowing users to stop on specific types of exceptions.
165-182
: New Method: SetExceptionBreakpoints.This method processes incoming requests to set exception breakpoints based on provided filters. It logs the command, constructs a list of accepted filters, and invokes
_process.SetExceptionsBreakpoints
.
212-217
: Conditional Breakpoints Support Added.The
Breakpoint
object now includes aCondition
property, allowing breakpoints to be set with specific conditions.
250-258
: Enhanced Error Reporting in ThreadStopped.The
ThreadStopped
function now includes anerrorMessage
parameter. If an error message is present, it is sent to the output stream, providing more context when a thread is stopped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
src/ScriptEngine/Machine/MachineInstance.cs (1)
1316-1316
: Ensure consistent formatting.The blank line added for separation is fine, but ensure consistent formatting throughout the file.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (9)
- src/OneScript.DebugProtocol/IDebuggerService.cs (1 hunks)
- src/OneScript.DebugServices/DefaultBreakpointManager.cs (2 hunks)
- src/OneScript.DebugServices/DefaultDebugService.cs (1 hunks)
- src/ScriptEngine/Machine/IDebugController.cs (1 hunks)
- src/ScriptEngine/Machine/MachineInstance.cs (2 hunks)
- src/VSCode.DebugAdapter/DebugSession.cs (3 hunks)
- src/VSCode.DebugAdapter/DebugeeProcess.cs (1 hunks)
- src/VSCode.DebugAdapter/OscriptDebugSession.cs (8 hunks)
- src/VSCode.DebugAdapter/OscriptProtocols/Tcp/TcpDebugServerClient.cs (1 hunks)
Files skipped from review as they are similar to previous changes (5)
- src/OneScript.DebugProtocol/IDebuggerService.cs
- src/OneScript.DebugServices/DefaultBreakpointManager.cs
- src/OneScript.DebugServices/DefaultDebugService.cs
- src/VSCode.DebugAdapter/DebugeeProcess.cs
- src/VSCode.DebugAdapter/OscriptProtocols/Tcp/TcpDebugServerClient.cs
Additional comments not posted (17)
src/ScriptEngine/Machine/IDebugController.cs (6)
27-28
: Addition ofSetExceptionBreakpoints
method approved.The method signature is clear and aligns with the interface's purpose.
28-30
: Modification ofSetBreakpoints
method approved.The updated method signature enhances functionality by allowing conditional breakpoints.
31-32
: Addition ofStopOnAnyException
method approved.The method signature is clear and aligns with the interface's purpose.
33-35
: Addition ofStopOnUncaughtException
method approved.The method signature is clear and aligns with the interface's purpose.
35-36
: Renaming ofFind
toFindBreakpoint
approved.The new name clarifies the method's purpose.
36-37
: Addition ofGetCondition
method approved.The method signature is clear and aligns with the interface's purpose.
src/VSCode.DebugAdapter/DebugSession.cs (3)
121-126
: Addition ofBreakpoint
constructor approved.The new constructor simplifies the instantiation of a
Breakpoint
when the line number is not specified.
272-273
: Optimization ofSetBreakpointsResponseBody
approved.The use of
Array.Empty<Breakpoint>()
enhances memory efficiency.
278-289
: Addition ofSetExceptionBreakpointsResponseBody
class approved.The class mirrors the structure of
SetBreakpointsResponseBody
and includes a constructor that initializes itsbreakpoints
property.src/VSCode.DebugAdapter/OscriptDebugSession.cs (5)
48-67
: Enhancement ofInitialize
method approved.The changes enhance debugging capabilities by enabling support for conditional breakpoints and exception filter options.
172-195
: Addition ofSetExceptionBreakpoints
method approved.The method processes incoming requests to set exception breakpoints based on filters provided in the arguments.
196-196
: Enhancement ofSetBreakpoints
method approved.The changes enhance the flexibility of breakpoint management by allowing breakpoints to be set with specific conditions.
192-192
: Modification ofThreadStopped
method approved.The changes allow the method to send error messages to the output stream if they are present, providing more context when a thread is stopped.
487-491
: Addition ofGetFromContainer
method approved.The method retrieves a value from a dynamic container, returning a default value if the property is not found.
src/ScriptEngine/Machine/MachineInstance.cs (3)
412-413
: VariableshouldRethrow
improves readability.The introduction of the
shouldRethrow
variable enhances the readability and maintainability of the exception handling logic.
414-418
: Expanded logic for emitting stop events is comprehensive.The expanded logic for emitting stop events now includes checks for both breakpoints and uncaught exceptions, providing a more comprehensive response to exceptions during execution.
1307-1315
: New methodEmitStopOnException
encapsulates stop event logic.The new method
EmitStopOnException
encapsulates the logic for handling stop events when exceptions occur, improving the modularity and readability of the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/OneScript.DebugServices/DefaultBreakpointManager.cs (2 hunks)
Additional comments not posted (6)
src/OneScript.DebugServices/DefaultBreakpointManager.cs (6)
18-21
: LGTM! Private fields are initialized properly.The
_exceptionBreakpointsFilters
and_breakpoints
fields are initialized correctly.
22-26
: LGTM! TheSetExceptionBreakpoints
method is implemented correctly.The method clears existing filters and populates
_exceptionBreakpointsFilters
with the provided filters.
Line range hint
27-36
:
LGTM! TheSetBreakpoints
method is implemented correctly.The method updates
_breakpoints
with the provided breakpoints, linking conditions to specific lines.
39-44
: LGTM! TheFindBreakpoint
andGetCondition
methods are implemented correctly.The methods find a breakpoint and retrieve its condition using LINQ.
47-49
: LGTM! TheClear
method is implemented correctly.The method clears
_breakpoints
and_exceptionBreakpointsFilters
.
51-67
: LGTM! TheStopOnAnyException
,StopOnUncaughtException
, andNeedStopOnException
methods are implemented correctly.The methods handle stopping on exceptions based on filters.
Может теряться сообщение об ошибке в условии точки останова:
|
А что ты ожидаешь там увидеть? |
Summary by CodeRabbit
New Features
Bug Fixes
Chores
package.json
for improved readability and structure, including the removal of the previously empty dependencies object.