Skip to content

Commit

Permalink
feat: initial implementation of hit condition breakpoints (microsoft#200
Browse files Browse the repository at this point in the history
)

* feat: initial implementation of hit condition breakpoints

First of all, apologies for the churn. While this change is relatively
simple, I realized that hit condition breakpoints further diverges the
user-defined breakpoints and the managed 'entrypoint' breakpoints (as
of microsoft#174), where we don't have hit conditions or DAP representations.

Therefore, there's now a base "Breakpoint" class which implements the
purely CDP-side of things, which a `UserDefinedBreakpoint` extends with
metadata around DAP, and the `EntryBreakpoint` extends in a minimal way.
After doing the split there was almost no changes the existing code
around the breakpoints, which is good evidence that we are indeed
dealing with two different types of things!

That done, there's a new `HitBreakpoint` class whose parsing logic is
copied from the existing debug adapters. The UserDefinedBreakpoint
optionally includes a HitBreakpoint, and we check on these when we hit
a location to see whether we should automatically continue, or not.

This works in my quick manual tests. Haven't had a chance to write unit
tests for this, but I wanted to get it in PR before I head out for the
holidays.

* fixup! entrypoint breakpoint behavior

Added fixes and unit tests while looking into microsoft#204.

 - Our nice new entrypoint breakpoint interfered with user-defined
   breakpoints. CDP errors if we try to set multiple breakpoints at the
   same locations, so if we see the user has a BP on the first line, we
   omit setting our automatic breakpoint. We also tweak behavior to
   treat any first-line breakpoint as an entrypoint breakpoint.
 - We were unnecessarily deduplicating breakpoint application requests
   which caused breakpoints which resolved to the exact same location in
   transpiled code to not get set.

* fixup! only retry in ci

* fixup! update the test assertions now that offsets are fixed
  • Loading branch information
connor4312 authored Jan 6, 2020
1 parent dcf125d commit 777a78b
Show file tree
Hide file tree
Showing 22 changed files with 906 additions and 549 deletions.
1 change: 1 addition & 0 deletions .ci/common-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ steps:
timeoutInMinutes: 10
condition: and(eq(${{ parameters.runTests }}, true), ne(variables['Agent.OS'], 'Darwin'))
env:
IS_CI: '1'
DISPLAY: ':99.0'

- task: Gulp@0
Expand Down
Loading

0 comments on commit 777a78b

Please sign in to comment.