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
Debugging seems off by one frame and focuses on the parent frame #15072
RStudio Edition : Desktop [Open Source]
RStudio Version : 2024.8.0.331
OS Version : Windows 10 x64 (build 19045)
R Version : R version 4.4.1 (2024-06-14 ucrt)
Set a breakpoint at the line of the `if() statement.
Call devtools::load_all() or source().
Call f_user_facing(2) in the console.
If this can't be reproduced easily,
Describe the problem in detail
It seems that the frame is off by one in this situation, and focuses on the parent function.
As you can see, the green arrow is not focused in the correct place.
Additional things I noted while trying to access objects
Warning in pos > offsets[linepref] :
size of a longer object is not a multiple of the size of a shorter object.
la taille d'un objet plus long n'est pas multiple de la taille d'un objet plus court
Calls: .rs.simulateSourceRefs -> which
Which suggests the sourceRefs aren't properly counted?
Also, I just upgraded to R 4.4.1 and don't remember this being in issue in R 4.3.2, but I may be mistaken.
Describe the behavior you expected
Note the correct functionality is working, it is just the editor focus that is not in the correct place. (i.e.
I would expect the editor to be focused)
A workaround for now is to insert a browser() statement.
Note that this is a very minimal reprex, but the issue makes debugging near impossible in larger context (when the 2 functions are in 2 different files for example)
changed the title [-]Debugging is off by one frame is srcRef i[/-][+]Debugging seems off by one frame and focuses on the parent frame[/+]on Aug 22, 2024
I think I can confirm what you saw -- the debugger works as expected with R 4.3.2, but this issue arises in R 4.4.1. Something must've changed in the R debugger internals that's tripping us up...
Activity
[-]Debugging is off by one frame is srcRef i[/-][+]Debugging seems off by one frame and focuses on the parent frame[/+]kevinushey commentedon Aug 22, 2024
I think I can confirm what you saw -- the debugger works as expected with R 4.3.2, but this issue arises in R 4.4.1. Something must've changed in the R debugger internals that's tripping us up...
olivroy commentedon Aug 23, 2024
I just saw the warning too on R 4.2.3 fwiw
The problem is likely that something doesn't get passed on correctly here
rstudio/src/cpp/session/modules/SessionEnvironment.R
Lines 347 to 379 in dc79f1e
Last modified in #14360
kevinushey commentedon Aug 23, 2024
Some more investigation; it seems like the issue only occurs when attempting to debug within a braced expression; e.g. with
Setting a breakpoint on
1 + 1seems to work;2+ 2does not. I also see the warning noted by @olivroy in the second case.kevinushey commentedon Aug 26, 2024
This should be fixed in the latest daily builds, available at https://dailies.rstudio.com/rstudio/kousa-dogwood/. Testing would be appreciated!
olivroy commentedon Sep 3, 2024
This seems resolved! Thanks
port debugger BRAT tests (4 of 8) to Playwright (#17710)