You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VS Code breakpoints skipped after Rails reloads related code #870
Add puts "foo" at app/controllers/posts_controller.rb:6
defindexputs"foo"@posts=Post.allend
Refresh the page in browser.
Expected behavior
VS Code breakpoints can still trigger after the file is updated.
Additional context
When updating other methods, like adding something to the new method (10 lines away), the breakpoint still works. So I suspect it's related to the breakpoint's iseq being outdated?
From DAP server logs, it looks like the debugger does receive updated setBreakpoints request:
Nothing to add other than to comment I have also been experiencing this bug. For the breakpoints to start registering after changing the code I have restart the server and attach the debug session again.
File.write("l.rb",<<RUBY) # l.rb def foo p 1 endRUBYload'l.rb'p:loeadeddebugger# set braekpoint at "l.rb:3" hereFile.write("l.rb",<<RUBY) def foo p 0 p 1 endRUBYload'l.rb'foo
File.write("l.rb",<<RUBY) def foo p 1 endRUBYload'l.rb'p:loeadeddebuggerdo: 'b l.rb:2'fooFile.write("l.rb",<<RUBY) def foo p 0 p 1 endRUBYload'l.rb'foo
Activity
st0012 commentedon Dec 16, 2022
I think it's related to
LineBreakpoint's@pendingstate:After the first breakpoint hit, the later breakpoint would has
@iseqlikeAnd this means its
@pendingstate would befalse.So when the
:script_compiledevent is triggeredbps_pending_until_load?would also befalseThreadClient.current.on_loadwouldn't be triggered for the updated codeLineBreakpointsBut I'm not sure which part is the root cause of the issue:
@iseqstill benil?bps_pending_until_load?also take the bps' file path into consideration?Workaround
As a quick workaround, changing
bps_pending_until_load?to just do@bps.any?seems to work.Workaround ruby#870
Workaround ruby#870
Workaround ruby#870
crobbo commentedon Jan 13, 2023
Nothing to add other than to comment I have also been experiencing this bug. For the breakpoints to start registering after changing the code I have restart the server and attach the debug session again.
A fix for this would be great!
ko1 commentedon Mar 25, 2023
ko1 commentedon Mar 25, 2023
Sorry it is not a correct repro-code.
It needs VSCode interaction.
ko1 commentedon Mar 25, 2023
All right, I repro it.
and next
foodoesn't stop.ko1 commentedon Mar 25, 2023
This is repro-code.
remain breakpoints on reloaded files
remain breakpoints on reloaded files
Merge v1.7.2 (#9)