Nil absolute path displayed for LineBreakpoint in ERB files

Open
#1,129 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
ruby
Domain
devtools

Research direction

Start with lib/debug/breakpoint.rb around lines 192 and 241, comparing how paths are assigned for breakpoints. Reproduce the ERB breakpoint example and inspect show_bps output. Done means ERB line breakpoints display their file path while continuing to stop at the specified line.

Written by the indexing model from the issue text.

Description

https://github.com/ruby/debug/blob/bead0984d241a91235e3d3bacd247f0363d2d530/lib/debug/breakpoint.rb#L192
The iseq.absolute_path seems to always be nil for .erb files even though the breakpoint works correctly and stops the execution
at the specifiied line in the erb file.

Therefore the show_bps is broken for such breakpoints showing only the line number:

break app/views/earth/users/index.html.erb:50
break 
0  BP - Line  :50 (line)

Should the mentioned code be changed to:

@path = iseq.absolute_path || iseq.path

like it is already done at:
https://github.com/ruby/debug/blob/bead0984d241a91235e3d3bacd247f0363d2d530/lib/debug/breakpoint.rb#L241

or should this be fixed at the ruby lang level and make iseq.absolute_path properly return the erb file's absolute path?

Dominant language
Ruby
Stars
1.3k
Forks
146
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ruby/debug

All issues in ruby/debug

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.