GDB for R? Some info on current use of GDB with R

Andrew Hoerner
Sat Dec 1 04:09:00 GMT 2018

There is actually a fairly extensive discussion of GDB in the R Manual
"Writing R Extensions" (available at, all in section 4 on
debugging. A lot of this discussion is over my head, but I think it is
mainly about debugging compiled code or non-R code called by R. At
least, no discussion of R debugging features I have ever seen before
mentions use of GDB as an option. So I suppose I should make clear
that my inquiry is about using GDB for debugging R code, not
"connected to R" code.

All of the references to GDB are under either subhead 4.3, "Checking
memory access," or section 4.4, "Debugging compiled code."
Here are the subject headings that contain explicit references to GDB:
4.3.2 Using valgrind
4.3.3 Using the Address Sanitizer
4.3.4 Using the Undefined Behaviour Sanitizer
4.4    Debugging compiled code
4.4.1 Finding entry points in dynamically loaded code
4.4.2 Inspecting R objects when debugging
On Thu, Nov 29, 2018 at 9:41 AM Pedro Alves <> wrote:
> On 11/29/2018 02:32 PM, Joel Brobecker wrote:
> > Hi Andrew,
> >
> >> I would very much like to know if there is any appreciable probability that
> >> there will be a GDB debugger for the R language in a time frame of months
> >> to single-digit years. I’d also like to know if there is pretty clearly no
> >> such probability.
> >
> > To the best of my knowledge, I haven't heard any rumours about adding
> > R support to GDB. But maybe others have heard something?
> I haven't either.
> I don't know much about how R works.  E.g., does it compile down to native
> code?  Or to some byte code that is JIT compiled at run time?  Or is
> it fully interpreted?
> Thanks,
> Pedro Alves

More information about the Gdb mailing list