You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and setting a breakpoint (same commands as in gdb so far) prints strange results:
(lldb) p dbg_print(x)
error: warning: '__cplusplus' macro redefined
previous definition is here
warning: '__GNUC__' macro redefined
previous definition is here
...
warning: '__LDBL_EPSILON__' macro redefined
previous definition is here
warning: '__LDBL_DENORM_MIN__' macro redefined
previous definition is here
error: Couldn't lookup symbols:
Rcpp::PreserveStorage<Rcpp::Vector<4> >::~PreserveStorage()
Rcpp::Vector<4>::Vector(Rcpp::Vector<4> const&)
but SEXP printing does work:
(lldb) p dbg_print(x.data)
[1] "foo" "bar" NA "hello"
Use clang instead of gcc to compile your C++ code: it gives much better error messages. You can make clang the default by creating a .R/Makevars (linux and mac) or .R/Makevars.win (windows) file in your home directory that contains:
CXX=clang++
But a first try with a clean & rebuild of CppDebugHelper only (not Rcpp) didn't help (debugging/stepping works, but printing not):
(lldb) p dbg_print(x)
error: CppDebugHelper.so DWARF DIE at 0x00099d2f (class String) has a member variable 0x00099d44 (buffer) whose type is a forward declaration, not a complete definition.
Try compiling the source file with -fstandalone-debug
error: Couldn't lookup symbols:
Rcpp::Vector<16>::Vector(Rcpp::Vector<16> const&)
Rcpp::traits::proxy_cache<16>::~proxy_cache()
Rcpp::PreserveStorage<Rcpp::Vector<16> >::~PreserveStorage()
It seems that R and Rcpp must be recompiled completely with clang++ (but clang++ seems to be supported by R only on OSX/Mac) to avoid mixing compilers...
in general you CANNOT mix C++ code from different compilers
Running
lldb
withand setting a breakpoint (same commands as in
gdb
so far) prints strange results:but SEXP printing does work:
Investigate this (low prio)...
See also:
Is it possible to debug a gcc-compiled program using lldb, or debug a clang-compiled program using gdb?
The text was updated successfully, but these errors were encountered: