Problem is that in RStudio when I set a breakpoint to debug the code then the debugger is not stepping into my functions properly. Rather it takes me to some unknown lands and gives the warning message "Debug location is approximate because the source is not available".
I can see similar stack overflow questions in past raising this Rstudio issue. I can also see the issue being raised and closed on Github but I am still facing this issue in the latest version. Can someone suggest a fix or workaround?
EDIT:
Here is a step by step description of the problem:
I have a project with various classes and functions distributed across many files and folders.
I wanted to follow the function calls from the top script. To do this I set a breakpoint in the top function. Then I sourced the script.
The debugger successfully stoped at the breakpoint. However, when I press "Step into the current function call" button, the debugger is taking me to some unknown code in the R language along with the error message that I mentioned. Looking at the code, it appears that the debugger is taking me to underlying R functions.
System
platform x86_64-apple-darwin17.0
arch x86_64
os darwin17.0
system x86_64, darwin17.0
status
major 4
minor 0.5
year 2021
month 03
day 31
svn rev 80133
language R
version.string R version 4.0.5 (2021-03-31)
nickname Shake and Throw
Apparantely it steps in to some random looking code and stops there, for example sometimes it stops here:
function (expr, msg)
{
on <- tracingState(FALSE)
if (on) {
on.exit(tracingState(TRUE))
if (!missing(msg)) {
call <- deparse(sys.call(sys.parent(1L)))
if (length(call) > 1L)
call <- paste(call[[1L]], "....")
cat("Tracing", call, msg, "\n")
}
exprObj <- substitute(expr)
eval.parent(exprObj)
}
NULL
}
browser()
call where the break point should be? – Shult