If gdbsource
is run non-interactively (the default) only
the relevant information will be printed. Note that this will only
work if the cpp file and the R file share the same base name.
gdbsource(file, interactive = FALSE)
"print"(x, ...)
gdbsource
backtrace
gdbsource(file)
.
Alternatively, If more detailed debugging is required, then
gdbsource(file,TRUE)
will provide the full backtrace followed
by an interactive gdb session where the individual frames can be inspected.
Note that templates should be compiled without optimization and with debug
information in order to provide correct line numbers:
compile(cppfile,"-O0 -g")
.
compile(cppfile,"-O1 -g",DLLFLAGS="")
(lower
optimization level will cause errors).