title: "Debug location is approximate because the source is not available" in R 4.0.0 + RStudio
body: <p>I've updated to R <code>4.0.0</code> and RStudio version <code>1.2.5042</code>.</p>
  
  <p>I'm developing a package and I've regularly used the following workflow:</p>
  
  <ol>
  <li>Build the package from within RStudio by clicking the "Install &amp; Restart" button (including the <code>--with-keep.source</code> R CMD INSTALL option).</li>
  <li>Set a breakpoint in the <code>.R</code> file of the function I want to debug.</li>
  <li>Call the function and wait for the debugger to stop exactly where I set the breakpoint.</li>
  </ol>
  
  <p>This used to work nicely. Now, however, I always get:</p>
  
  <blockquote>
    <p>Debug location is approximate because the source is not available</p>
  </blockquote>
  
  <p>This is annyoing because I can still debug, but I'm not in the actual function  anymore.</p>
  
  <p>Any hints/ideas why this is?</p>
  
  <h2>Edit (11.05.2020)</h2>
  
  <p>It seems like this is an issue with RStudio and R 4.0.0. Here is why I think so. I used another machine running Windows 10 and did the following steps (in this order; should be reproducible for Windows users). At the outset I had R 3.6.1 and RStudio 1.2.5042 installed (at the time of writing 1.2.5042 was the current version; tried also with the preview version 1.3.957 of RStudio).</p>
  
  <ol>
  <li><p>Clone the package I'm developing from Github:</p>
  
  <pre><code>git clone "https://github.com/M-E-Rademaker/cSEM"
  </code></pre></li>
  <li><p>Go to the package root and open <code>cSEM.Rproj</code></p></li>
  <li>Run <code>devtools::install_github("M-E-Rademaker/cSEM")</code> to automatically install the package and download all packages that <code>cSEM</code> depends on.</li>
  <li>In RStudio: click on "<code>Build</code>" install and "<code>Install and Restart</code>"</li>
  <li>Now naviagte to a source file. For example: <code>R/00_csem.R</code> and set a breakpoint in e.g. line 321.</li>
  <li><p>Now run the following piece of code:</p>
  
  <pre><code>model &lt;- "
  # Structural model
  eta2 ~ eta1
  eta3 ~ eta1 + eta2
  
  # Measurement
  eta1 =~ y11 + y12 + y13
  eta2 =~ y21 + y22 + y23
  eta3 =~ y31 + y32 + y33
  "
  
  res &lt;- csem(threecommonfactors, model)
  </code></pre>
  
  <p>The debugger should start and take you right to line 321. You should be able to alter code and you should <strong>NOT</strong> get the <em>"debug-location-is-approximate-because-the-source-is-not-availabe"</em> warning <strong>IF</strong> you are on an R version below 4.0.0.</p></li>
  <li>Go to <code>R/00_csem.R</code> and remove the breakpoint in line 321</li>
  <li>Close Rstudio and update R to 4.0.0 (using e.g. <code>installr::updateR()</code>)</li>
  <li>IMPORTANT: also get the newest version of Rtools and follow the steps on the website concerning the part where you need to add rtools to PATH. <a href="https://cran.r-project.org/bin/windows/Rtools/" rel="noreferrer">https://cran.r-project.org/bin/windows/Rtools/</a></li>
  <li>Since you need to reinstall all packages: open <code>cSEM.Rproj</code> again; run <code>install.packages("devtools")</code></li>
  <li>Now repeat steps 3, 4, 5, and 6.</li>
  <li>The debugger should stop at line 321 again, however, this time you <strong>do</strong> get the <em>"debug-location-is-approximate-because-the-source-is-not-availabe"</em> warning.</li>
  </ol>
  
  <p>Why is that? Any ideas/hints/suggestions are welcome!!</p>
  
  <p>Other things I tried:</p>
  
  <ul>
  <li>Deleting the package from win-library and reinstalling</li>
  <li>Reinstalling the package from GitHub using <code>devtools::install_github()</code></li>
  <li>Checked package root</li>
  <li>Updated all dependency packages </li>
  <li>Repeated the procedure on different machines</li>
  <li>I develop another package which you can clone from GitHub here: <a href="https://github.com/M-E-Rademaker/cSEM.DGP" rel="noreferrer">https://github.com/M-E-Rademaker/cSEM.DGP</a>. You can run the same procedure with this package, however, here I dont get the warning when using 4.0.0...which is extremly odd I think.</li>
  </ul>