Debugger Failing to Open

I am trying to use the debugger inside R studio and it's failing to open. I have the breakpoint toggled on. However, when ever the execution reach the breakpoint it simply terminates my program rather than entering into the debugging environment. This issue occurred both in R Studio Server and on my local machine which is running R Studio version 2023.06.0+421 on a Mac.

Our code base is so complicated so I am just going to peusdo-code what's going on.
I run a function called Main. Main in turn loads in the data and builds the arguments and then uses fastDoCall to pass those arguments to another function called DecilesPlotAllCrops.
DecilesPlotAllCrops is the function I am trying to debug. When the toggle point is inside DecilesPlotAllCrops I get the behavior described above where the program simply terminates instead of opening the debugger. However if I put the breakpoint inside of Main before the fastDoCall the debugger works correctly. So maybe the issue is with fastDoCall some how?
Additionally, the way Main calls DecilesPlotAllCrops appears to be anonymized:
plot <- fastDoCall(get(plotfunc), c(list(projection_spec=c(mainargs, list(DT=DT))), plotfunc_args))
However even when I change the call to be explicit
plot <- fastDoCall(DecilesPlotAllCrops, c(list(projection_spec=c(mainargs, list(DT=DT))), plotfunc_args))
I still get the same issue.

If you would like to recreate my issue fully I suggest you work with our repo directly. Our repo can be found on GitLab under CIL Ag Replication Package. I am working to debug Fig3/3b_3c_deciles/ the script that calls Main is found in Fig3/3b_3c_deciles/main_code/. While the functions Main and DecilesPlotAllCrops are defined in Fig3/3b_3c_deciles/background_code/figures_mac.R.
Setting my break point at line 83 in figures_mac.R works correctly but if I set it at line 820, where I actually want it, inside of DecilesPlotAllCrops it fails to open the debugger.

You might try R's lower level debugging tools if the breakpoints are not working for you. In this case you could try something like:

> debugonce(DecilesPlotAllCrops)

to tell R to enter the debugger the next time DecilesPlotAllCrops is called. Does that work?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.