debug icon indicating copy to clipboard operation
debug copied to clipboard

Nil absolute path displayed for LineBreakpoint in ERB files

Open charkost opened this issue 1 year ago • 0 comments

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?

charkost avatar Jan 02 '25 10:01 charkost