From edd at debian.org  Sun Feb  3 17:04:14 2008
From: edd at debian.org (Dirk Eddelbuettel)
Date: Sun, 3 Feb 2008 10:04:14 -0600
Subject: [Rd] gdb
In-Reply-To: <871w7ualss.fsf@DEBLAP1.BeNet>
References: <871w7ualss.fsf@DEBLAP1.BeNet>
Message-ID: <18341.58878.423585.780727@ron.nulle.part>


On 3 February 2008 at 01:08, Joe Bloggs wrote:
| I am using gdb to debug a c++ library I made for R using Rcpp.
| However, when I step through the code it seems to go all over the place, and some of the variables have been optimized out so I can't see their values.
| How can I compile without optimization?

Set MAKEFLAGS accordingly, possibly by editing R's Makeconf.  This is
documented in the 'R Extensions' manual.

| Also, is there any neat way to run R with gdb through emacs?

Yes, using 'M-x gdb' to launcg the gdb frontend. I also use ddd on Linux.

Using the debugger is also described in the 'R Extensions' manual.

Hope this helps, Dirk

-- 
Three out of two people have difficulties with fractions.



[Rd] gdb
Dirk Eddelbuettel