Skip to content
Prev 1787 / 10988 Next

[Rcpp-devel] R.e. Debugging Rcpp packages with GDB

On Tue, Jan 18, 2011 at 2:46 PM,
<rcpp-devel-request at lists.r-forge.r-project.org> wrote:
It's not very sophisticated, but I find that much of the time adding
Rf_PrintValue(xx) calls to code gives me as much info as I need.  If
it's a non-SEXP object like int, then Rf_PrintValue(wrap(my_int)).
I have 2 related "simple questions" after reading through Chapters 1
and 4 of "Writing R Extensions":

My build/test chain is:

R CMD INSTALL mypackage
R --vanilla --debugger gdb
run
require(mypackage)
<test in R>
quit()
<edit code>
R CMD INSTALL mypackage
run
require(mypackage) ## reload package with edits
<lather, rinse, repeat>

1)  Is there a "best" way to reload the shared library after
rebuilding it? dyn.unload() and dyn.load()?

2) Is there a simple way to include debugging symbols/keep values from
getting optimized out when building with Rcpp?

Thanks,
Christian