Hi, I'm trying to debug an R interface to a Fortran subroutine from Windows. (Yes, I know I should try Unix/Linux as well, but a quick attempt suggested that the (MinGW g77) Fortran compiler I have installed on my Windows laptop works better on this Fortran code.) I'm trying to follow the instructions in the "Writing R Extensions" Manual: Start R under the debugger after setting a breakpoint for WinMain. gdb .../bin/Rgui.exe (gdb) break WinMain (gdb) run But when I run gdb on Rgui.exe, I get the message: "no debugging symbols found" and then when I try "break WinMain", I get: "No symbol table is loaded. use the 'file' command." I'm using R 2.1.1 on Windows 2000 and gdb 5.2.1 from MSys's MinGW. I'm calling a Fortran function (several times) from R. And I seem to have the basic two-way data communication working - I appear to have succesfully passed all required data types (integer, real, double precision) to and from Fortran with sensible results both from within R and from using WRITE(FILENUM,*) from within Fortran. But unfortunately there is still evidence of memory leakage. Any suggestions would be greatly appreciated. Regards, James
James Wettenhall wrote:> Hi, > > I'm trying to debug an R interface to a Fortran subroutine from Windows. > (Yes, I know I should try Unix/Linux as well, but a quick attempt > suggested that the (MinGW g77) Fortran compiler I have installed on my > Windows laptop works better on this Fortran code.) > > I'm trying to follow the instructions in the "Writing R Extensions" Manual: > > Start R under the debugger after setting a breakpoint for WinMain. > gdb .../bin/Rgui.exe > (gdb) break WinMain > (gdb) run > > But when I run gdb on Rgui.exe, I get the message: > "no debugging symbols found" > and then when I try "break WinMain", I get: > "No symbol table is loaded. use the 'file' command." > > I'm using R 2.1.1 on Windows 2000 and gdb 5.2.1 from MSys's MinGW. > > I'm calling a Fortran function (several times) from R. And I seem to have > the basic two-way data communication working - I appear to have > succesfully passed all required data types (integer, real, double > precision) to and from Fortran with sensible results both from within R > and from using WRITE(FILENUM,*) from within Fortran. But unfortunately > there is still evidence of memory leakage. > > Any suggestions would be greatly appreciated.James, please read the posting guide which asks you to read the R for Windows FAQ (which includes an answer on the question "How do I debug code that I have compiled and dyn.load-ed?"). It also tells you to send a question like this (given it is not answered in the manuals or FAQs etc.) to R-devel rather than R-help. [hence further responses on this thread seem to be more appropriate for R-devel] Best, Uwe> Regards, > James > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[Moved from R-help] James Wettenhall wrote:> Hi, > > I'm trying to debug an R interface to a Fortran subroutine from Windows. > (Yes, I know I should try Unix/Linux as well, but a quick attempt > suggested that the (MinGW g77) Fortran compiler I have installed on my > Windows laptop works better on this Fortran code.) > > I'm trying to follow the instructions in the "Writing R Extensions" Manual: > > Start R under the debugger after setting a breakpoint for WinMain. > gdb .../bin/Rgui.exe > (gdb) break WinMain > (gdb) run > > But when I run gdb on Rgui.exe, I get the message: > "no debugging symbols found" > and then when I try "break WinMain", I get: > "No symbol table is loaded. use the 'file' command."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> > I'm using R 2.1.1 on Windows 2000 and gdb 5.2.1 from MSys's MinGW. > > I'm calling a Fortran function (several times) from R. And I seem to have > the basic two-way data communication working - I appear to have > succesfully passed all required data types (integer, real, double > precision) to and from Fortran with sensible results both from within R > and from using WRITE(FILENUM,*) from within Fortran. But unfortunately > there is still evidence of memory leakage. > > Any suggestions would be greatly appreciated. > > Regards, > James > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html