Debugging C++ code of an R package with Rcpp using gdb cannot print variable value with R_PV (unknown return type)

后端 未结 1 1651
名媛妹妹
名媛妹妹 2021-01-27 04:16

I have used RStudio on Ubuntu 18.04 to create an hello world R package using Rcpp like described here in Rcpp Package Development:

My ~/.R/Makevars contain

1条回答
  •  情书的邮戳
    2021-01-27 04:46

    (gdb) p R_PV(x)

    In my R source, R_PV is a function returning void. Try this instead:

    (gdb) call R_PV(x)
    

    As Dirk Eddelbuettel noted, you still need to pass the right type to R_PV, so perhaps the correct command is:

    (gdb) call R_PV(Rcpp::wrap(&x))
    

    0 讨论(0)
提交回复
热议问题