Skip to content

Debugging R/Fortran in Windows

4 messages · James Wettenhall, Duncan Murdoch

#
[Moved from R-help]
James Wettenhall wrote:
You can also start R normally, load your dll by attaching the package, 
then click on Misc | Break to debugger.

This assumes you have debugging symbols in your DLL, and have gdb set up 
properly; see

http://www.stats.uwo.ca/faculty/murdoch/software/debuggingR

for more details.

Duncan Murdoch
#
Thanks very much to Uwe, Duncan and Seth (who replied off the list).

Uwe - That section of the R for Windows FAQ was very useful - thanks! 
Sorry I posted a question involving C/Fortran to R-Help.

Duncan - Thanks for all the useful info.  I've bookmarked the pages you
sent me.

Seth - Thanks for suggesting valgrind.  I tried it out, and it correctly
told me that memory leakage was not the problem (although I didn't believe
it at first).

It turned out that the reason my variables were being overwritten was not
because of memory leakage, but because of my own stupidity - using the
same variable name for a function I was estimating and for my current
estimate of that function.  Sorry I didn't spend more time checking this
myself!

Thanks again for your help,
James
#
James Wettenhall wrote:
Is there a version of valgrind that works in Windows now, or did you do 
this test somewhere else?

Duncan Murdoch
#
Duncan,
No, I didn't find a version of valgrind that works on Windows.  I used it
on Linux.

Best wishes,
James