Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 调试Rcpp中的运行时错误_C++_R_Debugging_Rcpp - Fatal编程技术网

C++ 调试Rcpp中的运行时错误

C++ 调试Rcpp中的运行时错误,c++,r,debugging,rcpp,C++,R,Debugging,Rcpp,我已将R中的采样算法转换为Rcpp。Rcpp代码正在编译,但从eval(expr,envir,enclose)中的Rerror调用函数时出错。:索引超出范围。traceback()也不提供信息 7: stop(list(message = "index out of bounds", call = eval(expr, envir, enclos), cppstack = NULL)) 6: .Call("temp1_eeSNP_regress", PACKAGE = "temp1"

我已将R中的采样算法转换为Rcpp。Rcpp代码正在编译,但从eval(expr,envir,enclose)中的R
error调用函数时出错。
:索引超出范围。traceback()也不提供信息

7: stop(list(message = "index out of bounds", call = eval(expr, 
   envir, enclos), cppstack = NULL))  
6: .Call("temp1_eeSNP_regress", PACKAGE = "temp1", x, y, feature, 
   alpHa, gamMa_prob, beTa, estimate_alpha, estimate_beta, B_inv_alpHa, 
   itermax, thin, burnIn)  
5: eeSNP_regress(x = e.obj$x, y = e.obj$y, feature = e.obj$feature, 
   alpHa = e.obj$alpHa, beTa = e.obj$beTa, gamMa_prob = e.obj$gamMa.prob, 
   estimate_alpha = F, estimate_beta = T, B_inv_alpHa = rep(1/100, 
       dim(e.obj$feature)[2] + 1), itermax = 5000, thin = 40, 
   burnIn = 1000) at cmd.R#1  
4: eval(expr, envir, enclos)  
3: eval(ei, envir)  
2: withVisible(eval(ei, envir))

有没有办法在Rcpp中调试这样的运行时错误,而不是抛出一堆cout?有没有可能在R中调用gdb?

是的,您可以将
gdb
与R一起使用


例如,请参阅编写R扩展手册中的示例。

是的,您可以将
gdb
与R一起使用

例如,请参见编写R扩展手册中的示例