-
Notifications
You must be signed in to change notification settings - Fork 129
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
Disable cloned breakpoints trace point events #1008
Disable cloned breakpoints trace point events #1008
Conversation
@@ -1739,15 +1739,19 @@ def on_load iseq, src | |||
# check breakpoints | |||
if file_path | |||
@bps.find_all do |_key, bp| | |||
LineBreakpoint === bp && bp.path_is?(file_path) | |||
LineBreakpoint === bp && bp.path_is?(file_path) && (iseq.first_lineno..iseq.last_line).cover?(bp.line) |
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.
Here, we don't need to check breakpoints that are not covered by the iseq.
nbp = LineBreakpoint.copy(bp, iseq) | ||
add_bp nbp |
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.
LineBreakpoint.copy
always returns a breakpoint, so the if
here is not necessary.
I feel this kind of duplication check will introduce another issue (e.g. ISeq search order and so on) but try it. |
For what is worth, we've been trying it for a while and haven't noticed any other side effects. But it does fix the issue with ghost breakpoints. Thanks for merging! |
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [debug](https://github.com/ruby/debug) | `1.8.0` -> `1.9.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>ruby/debug (debug)</summary> ### [`v1.9.0`](https://github.com/ruby/debug/releases/tag/v1.9.0) [Compare Source](https://github.com/ruby/debug/compare/v1.8.0...v1.9.0) #### What's Changed - Configuration - `session_name` config by [@​ko1](https://github.com/ko1) in [https://github.com/ruby/debug/pull/1036](https://github.com/ruby/debug/pull/1036) - CLI - Require Reline 0.3.8+ to avoid frozen issue by [@​st0012](https://github.com/st0012) in [https://github.com/ruby/debug/pull/1020](https://github.com/ruby/debug/pull/1020) - Fix prompt list size and colorized code line size to match input line size passed to Reline by [@​tompng](https://github.com/tompng) in [https://github.com/ruby/debug/pull/1010](https://github.com/ruby/debug/pull/1010) - Fix broken command history when executing debugger on irb by [@​takatea](https://github.com/takatea) in [https://github.com/ruby/debug/pull/997](https://github.com/ruby/debug/pull/997) - Drop patch for Reline 0.2.7 by [@​st0012](https://github.com/st0012) in [https://github.com/ruby/debug/pull/1022](https://github.com/ruby/debug/pull/1022) - Support IRB console by [@​st0012](https://github.com/st0012) in [https://github.com/ruby/debug/pull/1024](https://github.com/ruby/debug/pull/1024) - Remote - Allow TracePoint reentry during DAP's evaluation by [@​st0012](https://github.com/st0012) in [https://github.com/ruby/debug/pull/1026](https://github.com/ruby/debug/pull/1026) - CDP: Add debuggerId field in the RETURN OBJECT of "Debugger.enable" by [@​ono-max](https://github.com/ono-max) in [https://github.com/ruby/debug/pull/1028](https://github.com/ruby/debug/pull/1028) - CDP: disable JavaScript engine based autocompletion by [@​ono-max](https://github.com/ono-max) in [https://github.com/ruby/debug/pull/1029](https://github.com/ruby/debug/pull/1029) - Do not use HEAD request if 1 port by [@​ko1](https://github.com/ko1) in [https://github.com/ruby/debug/pull/1035](https://github.com/ruby/debug/pull/1035) - Show session_name on connection by [@​ko1](https://github.com/ko1) in [https://github.com/ruby/debug/pull/1037](https://github.com/ruby/debug/pull/1037) - Internal - Stop assuming Integer#times is written in C by [@​k0kubun](https://github.com/k0kubun) in [https://github.com/ruby/debug/pull/1015](https://github.com/ruby/debug/pull/1015) - Disable cloned breakpoints trace point events by [@​vinistock](https://github.com/vinistock) in [https://github.com/ruby/debug/pull/1008](https://github.com/ruby/debug/pull/1008) - Unfreeze threads for some object-evaluating commands by [@​st0012](https://github.com/st0012) in [https://github.com/ruby/debug/pull/1030](https://github.com/ruby/debug/pull/1030) - Prevent backtrace from hanging if objects in the backtrace use Thread in inspect by [@​vinistock](https://github.com/vinistock) in [https://github.com/ruby/debug/pull/1038](https://github.com/ruby/debug/pull/1038) - Compile iseq_collector.c logic only on CRuby by [@​eregon](https://github.com/eregon) in [https://github.com/ruby/debug/pull/1039](https://github.com/ruby/debug/pull/1039) - Fix compatibility with Fiber Scheduler. by [@​ioquatix](https://github.com/ioquatix) in [https://github.com/ruby/debug/pull/987](https://github.com/ruby/debug/pull/987) - Do not make a Fiber for commands by [@​ko1](https://github.com/ko1) in [https://github.com/ruby/debug/pull/1044](https://github.com/ruby/debug/pull/1044) - support Ruby 3.3 by [@​ko1](https://github.com/ko1) in [https://github.com/ruby/debug/pull/1045](https://github.com/ruby/debug/pull/1045) - Misc/Doc - Fix ruby warnings by [@​y-yagi](https://github.com/y-yagi) in [https://github.com/ruby/debug/pull/993](https://github.com/ruby/debug/pull/993) - Fix a typo by [@​makenowjust](https://github.com/makenowjust) in [https://github.com/ruby/debug/pull/988](https://github.com/ruby/debug/pull/988) - Update `TrapInterceptor` to avoid assigning to an unused variable by [@​DavidZivk](https://github.com/DavidZivk) in [https://github.com/ruby/debug/pull/985](https://github.com/ruby/debug/pull/985) - remove debug print by [@​ko1](https://github.com/ko1) in [https://github.com/ruby/debug/pull/1043](https://github.com/ruby/debug/pull/1043) - Minor punctuation and grammar fixes by [@​ahangarha](https://github.com/ahangarha) in [https://github.com/ruby/debug/pull/1041](https://github.com/ruby/debug/pull/1041) - Tests - Bump actions/checkout from 3 to 4 by [@​dependabot](https://github.com/dependabot) in [https://github.com/ruby/debug/pull/1014](https://github.com/ruby/debug/pull/1014) #### New Contributors - [@​dependabot](https://github.com/dependabot) made their first contribution in [https://github.com/ruby/debug/pull/1014](https://github.com/ruby/debug/pull/1014) - [@​tompng](https://github.com/tompng) made their first contribution in [https://github.com/ruby/debug/pull/1010](https://github.com/ruby/debug/pull/1010) - [@​takatea](https://github.com/takatea) made their first contribution in [https://github.com/ruby/debug/pull/997](https://github.com/ruby/debug/pull/997) - [@​y-yagi](https://github.com/y-yagi) made their first contribution in [https://github.com/ruby/debug/pull/993](https://github.com/ruby/debug/pull/993) - [@​DavidZivk](https://github.com/DavidZivk) made their first contribution in [https://github.com/ruby/debug/pull/985](https://github.com/ruby/debug/pull/985) - [@​eregon](https://github.com/eregon) made their first contribution in [https://github.com/ruby/debug/pull/1039](https://github.com/ruby/debug/pull/1039) - [@​ahangarha](https://github.com/ahangarha) made their first contribution in [https://github.com/ruby/debug/pull/1041](https://github.com/ruby/debug/pull/1041) - [@​ioquatix](https://github.com/ioquatix) made their first contribution in [https://github.com/ruby/debug/pull/987](https://github.com/ruby/debug/pull/987) **Full Changelog**: ruby/debug@v1.8.0...v1.9.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/powerhome/audiences). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy44Ny4yIiwidXBkYXRlZEluVmVyIjoiMzcuODcuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Description
We're currently not invoking
bp.disable
orbp.delete
on the cloned breakpoint. This means that the associated trace point event continues to be enabled.Most of the time, that's not an issue because the target
@iseq
will not match. But there are some cases where old@iseq
objects may continue to exist and we will continue having the execution suspended by the old trace point.One example scenario of this is when using aliases, which hold references to the old
@iseq
(see the test, which reproduces the issue).Depending on the order of events, this sometimes leads to execution being suspended by breakpoints that were already removed - because the trace point event is still enabled, even if the breakpoint was removed from the hash. Disabling the trace point for the removed breakpoint ensures that we can't get the execution suspended by these removed breakpoints.