Repository navigation
Report the end line at TracePoint :return and :b_return events - #10103
Open
sampokuokkanen wants to merge 1 commit into
Open
sampokuokkanen wants to merge 1 commit into
sampokuokkanen wants to merge 1 commit into
Conversation
With --debug, the :return event at the end of a method reported the line before its end, because the end line was passed to the trace without converting it to a 1-based line as the other events do. The :b_return event reported the right line, but the block was still at the line of its last expression in the backtrace, so a debugger showed a different line than the event. A block or lambda is now at its end line while the hook runs, as a method already was for :return.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
--debug, the:returnevent at the end of a method reports the line before itsend. The:b_returnevent reports the right line, but during the hook the block is still at its last expression in the backtrace. CRuby reports theendline in both places. Debuggers built on TracePoint, like ruby/debug, show the backtrace line, so they disagree with the event (ruby/debug#1120).The
:returntrace got the 0-based end line, while the other events get a 1-based line. Blocks and lambdas now set their end line before:b_return, as methods already did before:return.