-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Exclude internal frames from backtrace #13238
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
Merged
Merged
Conversation
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
951718e
to
fdaf9c4
Compare
mame
added a commit
to mame/debug
that referenced
this pull request
Jun 4, 2025
In Ruby 3.5, `Kernel#caller_location` will not include `<internal:xxx>` frames. ruby/ruby#13238 To skip the internal frames, explicitly check if `TracePoint#path` is a internal path or not.
This was referenced Jun 4, 2025
mame
added a commit
to mame/irb
that referenced
this pull request
Jun 4, 2025
In ruby 3.5, `Kernel#caller_location` will not include `<internal:xxx>` frames. Instead, it will use its caller-side location for an internal frame. ruby/ruby#13238 This change updates the expected values of backtraces in irb test to support the behavior change.
This comment has been minimized.
This comment has been minimized.
9625778
to
60b3786
Compare
ko1
pushed a commit
to ruby/debug
that referenced
this pull request
Jun 5, 2025
In Ruby 3.5, `Kernel#caller_location` will not include `<internal:xxx>` frames. ruby/ruby#13238 To skip the internal frames, explicitly check if `TracePoint#path` is a internal path or not.
ba6dcf0
to
905775a
Compare
mame
added a commit
to mame/irb
that referenced
this pull request
Jun 18, 2025
In ruby 3.5, `Kernel#caller_location` will not include `<internal:xxx>` frames. Instead, it will use its caller-side location for an internal frame. ruby/ruby#13238 This change updates the expected values of backtraces in irb test to support the behavior change.
905775a
to
52b3360
Compare
mame
added a commit
to ruby/irb
that referenced
this pull request
Jun 18, 2025
In ruby 3.5, `Kernel#caller_location` will not include `<internal:xxx>` frames. Instead, it will use its caller-side location for an internal frame. ruby/ruby#13238 This change updates the expected values of backtraces in irb test to support the behavior change.
52b3360
to
b9ff12f
Compare
In preparation for using it to update not only cfunc frames but also internal frames, the function (and related variable names) are chagned. I felt that the word "backpatch" is more appropriate than the more general verb "update" here.
This changeset suppresses backtrace locations like `<internal:array>:211` as much as possible. Before the patch: ``` $ ruby -e '[1].fetch_values(42)' <internal:array>:211:in 'Array#fetch': index 42 outside of array bounds: -1...1 (IndexError) from <internal:array>:211:in 'block in Array#fetch_values' from <internal:array>:211:in 'Array#map!' from <internal:array>:211:in 'Array#fetch_values' from -e:1:in '<main>' ``` After the patch: ``` $ ./miniruby -e '[1].fetch_values(42)' -e:1:in 'Array#fetch_values': index 42 outside of array bounds: -1...1 (IndexError) from -e:1:in '<main>' ``` Specifically: * The special backtrace handling of BUILTIN_ATTR_C_TRACE is now always applied to frames with `<internal:...>`. * When multiple consecutive internal frames appear, all but the bottom (caller-side) frame are removed. [Misc #20968]
b9ff12f
to
c1464ba
Compare
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.
This PR suppresses backtrace locations like
<internal:array>:211
as much as possible.Before the patch:
After the patch:
Specifically:
<internal:...>
.Fixes [Misc #20968]