[Rcpp-devel] Debug Rcpp datatypes with lldb

Huelsmann, Till till.huelsmann at mpibpc.mpg.de
Thu Dec 6 14:29:07 CET 2018


Hello,

First of all, I really like Rccp and would like to thank you all for your work.
I try to debug an cpp file, which I source from R, using the lldb debuger.

sourceCpp("source.cpp")

Everything is woking fine, but I dont get how can I show the content of specific datatypes. Like NumericVector or CharackterVector.

E.g.:

(lldb) fr v myvec gives me:

(Rcpp::CharacterVector) myvec= {
  Rcpp::PreserveStorage<Rcpp::Vector<4> > = (data = 0x000055555899e970)
  cache = {
    p = 0x00007fffffffc070
  }
}

How it is possible to get the values of the vector in lldb?
I think, that the struct CharacterVector only stores the Memory address of the data.

I have the same problem with NumericVectors, which are stored as double.
If I tried to access them (format as double, 2072 bytes) but I didn´t get the expected values:

(lldb) memory read –format f 0x000055555899e970
(llldb) memory read -s2072 -fu -c2072 0x000055555899e970 --force


Maybe I have a mistake. I would be very happy if someone could help me.
I've already posted this question on Stackoverflow, but have not received an answer.
See: https://stackoverflow.com/questions/53611600/debug-rcpp-with-lldb

Bests,
Till
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20181206/fe725879/attachment.html>


More information about the Rcpp-devel mailing list