This project is read-only.
This is a page gathering how-tos and links to relevant information to get some things running.

Debugging with Monodevelop

At some point in the past, I did manage to have the rClr native code debugged from Monodevelop. I think, anyway. Seems I cannot anymore.

Now regarding how to figure how the following issue, which ends up with the R console spitting the dummy. How to set up the mono soft debugger to attach to the R process.
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at RDotNet.Devices.CharacterDeviceAdapter.ResetConsole () [0x00000] in <filename unknown>:0


Seems that following the instructions work. Can hook up breakpoints. However when trying to debug the R.NET related issue, catching the exception fails. The mono runtime spits the dummy with a SIGSEV.

Debugging tools

Aside from valgrind, sayw the mention on the R-devel mailing list of the AddressSanitizer. Seems to be soon included in LLVM clang and gcc.

Data marshalling

The following links stem from looking how to invoke from rClr.dll a managed method such as "public object CreateSomeRdotNetStructure(IntPtr ptr, int sexptype)". It looks like the corresponding type to IntPtr is (void *), but while P/Invoke from C# works, rdotnet as a proof, I could not find the other way around to obtain an IntPtr. I think I could create the IntPtr in C# from end int or long, but this is where the rub is: a platform-dependent code...

Platform Invoke Data Types

VARIANT Type Constants

May be of interest:

VARIANT structure

An interested pointer, albeit not actively maintained:

Other links of interest

Read and the follow up article.

Last edited Jun 29, 2013 at 9:01 AM by jperraud, version 5


No comments yet.