加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

如何在R中打破C源代码?

发布时间:2020-12-16 09:59:40 所属栏目:百科 来源:网络整理
导读:我想在model.matrix的C实现中设置一个断点.我在 How can I view the source code for a function?尝试了Selva的解决方案: debug(C_modelmatrix)Error in debug(C_modelmatrix) : object 'C_modelmatrix' not found debug(modelmatrix)Error in debug(modelm
我想在model.matrix的C实现中设置一个断点.我在 How can I view the source code for a function?尝试了Selva的解决方案:

> debug(C_modelmatrix)
Error in debug(C_modelmatrix) : object 'C_modelmatrix' not found
> debug(modelmatrix)
Error in debug(modelmatrix) : object 'modelmatrix' not found

我感兴趣的功能可以在here找到.

SEXP modelmatrix(SEXP call,SEXP op,SEXP args,SEXP rho

我正在构建并运行R源代码.如何设置断点?

解决方法

Seth Falcon在 how to debug R packages with native code上仍然有用的视频教程显示了这一点.

本质上,使用R -d gdb启动R来调用gdb调试器,然后指示在正确的位置设置断点.

如果您(或您的操作系统)更喜欢不同的编译器,您显然需要在调用中替换它:R -d lldb.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读