[ESS] Interaction of ESS and gud-mode for gdb debugger

Douglas Bates bates at stat.wisc.edu
Fri Dec 4 19:52:47 CET 2009

I'm not sure if this is an interaction of gud-mode and ESS but I am
unable to use gdb on compiled R code in the way that I could

The operating system is Ubuntu 9.10 on an amd64 desktop running what
is still called emacs-snapshot, even though it is now the released
version.  To be specific the emacs is

GNU Emacs (x86_64-pc-linux-gnu, GTK+ Version 2.18.0) of
2009-09-27 on crested, modified by Debian

with ESS version 5.4.  The version of gdb is

GNU gdb (GDB) 7.0-ubuntu

I'm not sure what the version of gud-mode is but it would be the
version shipped with this emacs as I haven't altered it since the
initial install.

The way that I debug compiled code for R is to start R with ESS (i.e.
M-x R), load any packages that I need, then start gdb on the R
executable.  At that point I determine the process number of the R
process (e.g. M-! pgrep R) and in the gud-gdb buffer attach the
debugger to that process and set any necessary breakpoints.  In the
past the gud-gdb buffer would show that it was reading the symbols
from the various shared objects then it would give a prompt where I
could set breakpoints.  The *R* buffer would be frozen while this was
going on.  To return control of the R process you send the 0 signal
(i.e. sig 0) from the *gud-gdb* buffer.

I still get the output about reading the symbol tables but I no longer
get a prompt in the *gud-gdb*.  If I try to recover a prompt, say with
C-g, the R process in the *R* buffer is killed.

I imagine this change is documented somewhere and I could find out by
reading the gdb and perhaps the gud-mode documentation but right now I
would really prefer to spend my time debugging my code, instead of
learning about new capabilities.  Does anyone have any hints of where
to look or what to do?

More information about the ESS-help mailing list