Re: [Rd] How to debug an R package (with C code)

2014-01-20 Thread Gábor Csárdi
I don't know where you have gdb from, but it is not included in the latest xcode, afaik. If you install it by hand, or from brew, then you'll see what I saw. Maybe you have a gdb version from an older xcode lying around, or I don't know. See also

Re: [Rd] How to debug an R package (with C code)

2014-01-19 Thread Davor Cubranic
On Jan 17, 2014, at 6:17 AM, Gábor Csárdi csardi.ga...@gmail.com wrote: Small note: if you are using a recent version of OSX, then gdb is essentially useless, but you can use llvm, which is nicer in many respects, anyway. What do you mean by this? Gdb is a debugger, and LLVM is a compiler

Re: [Rd] How to debug an R package (with C code)

2014-01-19 Thread Gábor Csárdi
On Sun, Jan 19, 2014 at 1:53 PM, Davor Cubranic cubra...@stat.ubc.cawrote: On Jan 17, 2014, at 6:17 AM, Gábor Csárdi csardi.ga...@gmail.com wrote: Small note: if you are using a recent version of OSX, then gdb is essentially useless, but you can use llvm, which is nicer in many respects,

Re: [Rd] How to debug an R package (with C code)

2014-01-19 Thread Davor Cubranic
I’m not sure what’s going on with your setup, but this is what I get on my machine when I press Ctrl-C just after the R prompt comes up when started with “R -d gdb: Program received signal SIGINT, Interrupt. 0x7fff874179aa in select$DARWIN_EXTSN () (gdb) bt #0 0x7fff874179aa in

Re: [Rd] How to debug an R package (with C code)

2014-01-17 Thread Sandip Nandi
Hi , The video may help you http://vimeo.com/11937905 Thanks, Sandip On Thu, Jan 16, 2014 at 4:17 PM, Ma, Saisai - maysy020 saisai...@mymail.unisa.edu.au wrote: Hi all, Sorry to bother you. I am a beginner in R programming. I have encountered some problems when I modified a R package

Re: [Rd] How to debug an R package (with C code)

2014-01-17 Thread Gabriel Becker
Saisai, I haven't watched the specific video Sandip posted, but from the title it looks to be correct. Running R with/in gdb is the correct way to debug C code in R packages. One thing to watch out for: The default compiler flags for C/C++ code in R packages call for substantial optimization (I

Re: [Rd] How to debug an R package (with C code)

2014-01-17 Thread Peter Meilstrup
On Fri, Jan 17, 2014 at 12:43 AM, Gabriel Becker gmbec...@ucdavis.edu wrote: There were some deeper issues with what you asked, though. Sourcing an R file will have no effect on a package in the namespace at all unless you are using something like ESS's developer mode which sources the file

Re: [Rd] How to debug an R package (with C code)

2014-01-17 Thread Hadley Wickham
Even if you are using a developer mode, sourcing an R file will have no effect on a) the shared object library (DLL/so/dylib) available in the R session, nor which shared objects are associated with the package. There are ways to unload shared libraries within an R session, but personally I

[Rd] How to debug an R package (with C code)

2014-01-16 Thread Ma, Saisai - maysy020
Hi all, Sorry to bother you. I am a beginner in R programming. I have encountered some problems when I modified a R package with C code. I would like to modified the C code within the R package, and want to debug the C program. But I have no idea how to debug this kind of R package. In the