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
Stepping with duplicated lines can be wrong when keep.source = FALSE #14276
CC @kevinushey, this is what I mentioned yesterday about seeing cases where duplicate lines make the debugger bounce around
Let's fake the idea of stepping into a function from a package where you don't have source refs (pretty common)
eval(parse(text="fn <- function() { x <- 1 1 + 1 x <- 1 2 + 2 3 + 3 x <- 1 1}", keep.source=FALSE))
debugonce(fn)
fn()
Note that x <- 1 is duplicated here. This results in the following stepping behavior:
Screen.Recording.2024-02-15.at.11.58.41.AM.mov
If you remove the keep.source = FALSE part, then things do work as expected.
I know that when there aren't source refs, we essentially end up grepping for x <- 1 in the sources of the function itself. It seems like we try and keep track of the previous debug line and use it as a minimum "line preference" here:
Activity
jthomasmock commentedon Feb 29, 2024
Might be related to #13925
ronblum commentedon Mar 13, 2024
Verified that debugger doesn't jump around in