[Rcpp-devel] Debugging an Rcpp/RCppArmadillo program?

Dirk Eddelbuettel edd at debian.org
Mon Apr 8 16:57:13 CEST 2013

On 8 April 2013 at 16:37, Stefano Calza wrote:
| Hi,
| if you use emacs you might do the following (tested in Linux, but ideally
| possible in Windows too):
| 1) open R in emacs (M-x R) and load the *.so. At developement stage it might be
| useful to use sourceCpp
| 2) open gdb (M-x gdb) in emacs
| 3) look for R session id (see "ps" command), let's assume it's 1234
| 4) In the gdb shell:
|     a) attach 1234
|     b) set breakpoints
|     c) signal 0
| 5) now run R commands and you'll get the debugger stop once into you code

Right -- there is a write-up by Doug Bates "somewhere". Might have an older R
News / R Journal that documents this but have the gist of it here: find the
process, attach to it, be merry.


Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com

More information about the Rcpp-devel mailing list