<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
if you use emacs you might do the following (tested in Linux, but
ideally possible in Windows too):<br>
<br>
1) open R in emacs (M-x R) and load the *.so. At developement stage
it might be useful to use sourceCpp<br>
2) open gdb (M-x gdb) in emacs<br>
3) look for R session id (see "ps" command), let's assume it's 1234<br>
4) In the gdb shell:<br>
a) attach 1234<br>
b) set breakpoints<br>
c) signal 0<br>
5) now run R commands and you'll get the debugger stop once into you
code<br>
<br>
Stefano<br>
<br>
<br>
<br>
<br>
<br>
On 04/08/2013 03:27 PM, Andre Mikulec wrote:
<blockquote cite="mid:BLU174-W31B9BC402F65E9D9AB13CF9CC50@phx.gbl"
type="cite">
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style>
<div dir="ltr"><font face="Courier New">
Hi,<br>
<br>
Pardon me. I am relatively new.<br>
<br>
What is a way ( or effective way ) to debug an
Rcpp/RCppArmadillo program that is running within R?<br>
<br>
Do I try somehow to set an inline RCpp/RCppArmidillo <br>
script attribute to 'Debug' ( if this exists? )<br>
<br>
Do I recompile R ( with perhaps 'g++ -g -O0' and try to debug
an<br>
Rcpp/RCpp Armadillo file (.so/.dll) in an attached process in
the gdb debugger?<br>
<br>
Do I just create an ( independent from R ) Armadillo C++
program .exe ( made with 'g++ -g -O0 )<br>
( and use my own BLAS/LAPACK ) outside of R, and just debug
the .exe it using gdb?<br>
<br>
Or, do I simply, in R, just put many 'print statements' in the
inline RCpp/RCppArmidillo script?<br>
<br>
What is a strategy?<br>
<br>
Thank you,<br>
Andre Mikulec<br>
<a moz-do-not-send="true"
href="mailto:Andre_Mikulec@Hotmail.com">Andre_Mikulec@Hotmail.com</a><br>
<br>
</font> </div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Rcpp-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a>
<a class="moz-txt-link-freetext" href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a></pre>
</blockquote>
<br>
</body>
</html>