From ripley at stats.ox.ac.uk  Mon Apr 23 09:33:08 2007
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Mon, 23 Apr 2007 08:33:08 +0100 (BST)
Subject: [Rd] How to debug C code running in R
In-Reply-To: <dde9f9a92244a.462bd1c4@usc.edu>
References: <dde9f9a92244a.462bd1c4@usc.edu>
Message-ID: <Pine.LNX.4.64.0704230830010.22687@gannet.stats.ox.ac.uk>

You haven't told us your OS (as asked for in the posting guide).  But

Writing R Extensions section 4.4
rw-FAQ Q8.4

both appear to give the instructions you are asking for.

On Sun, 22 Apr 2007, Tong Wang wrote:

> Hi,

>    I am in the situation where I could get my code run correctly under 
> GNU C, but it produced different (strange) results while running in R . 
> ( I use .C to call the function).  May I get some general advice on how 
> could I do step by step debug of source code in R ?
>
> Thanks

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] How to debug C code running in R
Prof Brian Ripley