Skip to content

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Apr 12, 2022

Main Changes

  1. Session#add_bp should return either nil (duplicated bp being rejected) or the Breakpoint object. Currently it returns true for duplicated breakpoints (from bp.delete), which makes setExceptionBreakpoints returns verify: true incorrectly. (see the 3rd commit)
  2. The setExceptionBreakpoints command should clear all breakpoints before creating the assigned ones. Otherwise, it's not possible to deactivate exception breakpoints. After the changes, its behavior would follow setBreakpoints command and align with debugpy's implementation.
  3. It supports setting conditions with exception breakpoints.

Other Changes

  1. Test framework's send_request helper should also provide protocol messages when seeing exceptions (e.g. when the debugger exists expectedly). Currently it doesn't print those messages and makes it hard to debug.
  2. To support the improved setExceptionBreakpoints command, I also updated req_set_exception_breakpoints helper.

@st0012
Copy link
Member Author

st0012 commented Apr 17, 2022

@ono-max can you also give this a look? thx

end
{
verified: bp ? true : false,
verified: !bp.nil?,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bp can be false?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it should be false in any case. If it's not added, it should just be nil. Why do you expect it to be false too?

Copy link
Collaborator

@ko1 ko1 Apr 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to know the reason why the change is needed (and not sure why yet).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a necessary change so if you don't want it I can revert it.

st0012 added 5 commits April 24, 2022 10:43
There are many types of Breakpoint uses an array as key.
e.g. ISeqBreakpoint - `[:iseq, @iseq.path, @iseq.first_lineno]`

So the current condition doesn't accurately selects line breakpoints.
Currently, if the request failed because the debugger exists early
(broken pipe error), it doesn't provide the same information shown when
a test fails. And that makes it hard to debug, so we should show helpful
info in those cases as well.
It should return either `nil` (if bp is duplicated) or the `bp.inspect`.
Currently it returns `true` for duplicated because of `bp.disable`.
1. Allow unset exception breakpoints by sending empty filters.
2. Support adding condition to exception breakpoints.
@st0012 st0012 force-pushed the dap-improvements branch from be15123 to b784aaa Compare April 24, 2022 09:47
Copy link
Member

@ono-max ono-max left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for my late reviews.

Nice. LGTM

@st0012 st0012 force-pushed the dap-improvements branch from b784aaa to 8ae2b10 Compare April 29, 2022 08:30
@ko1 ko1 merged commit d270e3f into ruby:master May 2, 2022
@st0012 st0012 deleted the dap-improvements branch May 2, 2022 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants