[R] Modern Symbolic debugger for R programmes?

Duncan Murdoch murdoch.duncan at gmail.com
Tue Oct 9 12:03:33 CEST 2012


On 12-10-09 12:12 AM, Worik R wrote:
> I think I am whistling in the wind, but is there a modern symbolic
> debugger for R programmes?
>
> I am working through some  one else's code, thousands of lines, that
> has the occasional bug in it, and a lot in my understanding of it.
>
> I cannot make setBreakpoint or findLineNum  work.  I get "No source
> refs found.".  I am starting to loose my mind!

You need to source the code with source references.  That is the default 
for source(), but not for package installation.  Set env variable 
R_KEEP_PKG_SOURCE=yes for command line installs; 
option(keep.source.pkgs=TRUE) for installs from within R.

Then you need to tell setBreakpoint where to look, through the "envir" 
arg.  See the 2nd example in the help page.

> A debugger where I could set breakpoints with a little more
> granularity than the function level and a little more accessible than
> the trace function.  What I ideally want is GDB for R.

I thought you said you wanted a modern debugger :-).  GDB is very 80ish. 
I'm unaware of any debuggers that I would consider "modern", i.e. like 
the debuggers from the 90s, but there are a number of pre-modern choices 
that others have mentioned, and I don't think anyone has mentioned the 
debug package.

Duncan Murdoch




More information about the R-help mailing list