Raising this one again as it has still not been meaningfully addressed.
While debugging code in Rstudio, I frequently execute a function and return to the console. Nothing is executing at this point. Termination may be as a consequence of an error, or not.
I then try to set a breakpoint in the function (often from links in the Traceback).
But it does not allow a breakpoint to be set with this message:
Breakpoints will be activated when the file or function is finished executing.
This does not happen all the time, only intermittently, but often enough to be very disruptive, and being intermittent very difficult to isolate.
So far I have found the only way to reset this is to restart the R session. This may then necessitate repeating a number of setup steps before being able to reproduce the issue that I am debugging.
This is very tedious.
It does not appear to be possible to create a succinct reprex example as the behaviour is intermittent and is unrelated to the actual code being run.
We do use the trace() function to track execution. It is possible that this is interfering with RStudio execution status. However we have found no direct association between the application of trace() and this issue occurring, either in time or in functions applied to.
[I came across a reference to a possible conflict issue with trace() in a post by Hadley, but can no longer find this]
I am happy to engage in a conversation that may help to pin down the cause as this is very disruptive and time wasting.